如何在Laravel5中更改视图文件夹? [英] How change view folder in Laravel5?

查看:340
本文介绍了如何在Laravel5中更改视图文件夹?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用Laravel 5和AngularJS开发一个Web应用程序.我在客户端使用纯angularJS应用程序,并将客户端应用程序文件(视图)放在我的public文件夹中.

I am developing an web application using Laravel 5 and AngularJS. I am using pure angularJS app for the client side and I am putting the client app files (views) in my public folder.

在Laravel 4中,我可以更改bootstrap/start.php文件中的路径.但是在Laravel 5中,我看不到start.php文件.那么我在哪里可以更改Laravel 5中的配置?

In Laravel 4, I could change the path from the bootstrap/start.php file. But in Laravel 5, I can not see the start.php file. So where do I change the configuration in Laravel 5?

推荐答案

请参见config/view.php的第16行(查看存储路径"部分)

See line 16 of config/view.php (the "View Storage Paths" section)

'paths' => [
    realpath(base_path('resources/views'))
],

因此您可以将其更改为realpath(base_path('public/assets/views'))以便进入您的公开路径.

So you might change it to realpath(base_path('public/assets/views')) to be in your public path.

'paths' => [

    // src/MyNamespace/resources
    realpath(base_path('src/MyNamespace/resources')),

    // app/resources
    realpath(app_path('resources'))

],

  • 您可以提供多个搜索位置
  • 您可以使用app_path()base_path()或都不使用.
    • You can provide multiple search locations
    • You can use app_path(), base_path(), or neither.
    • 这篇关于如何在Laravel5中更改视图文件夹?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆