dongyan7988 2015-03-03 22:34
浏览 37
已采纳

如何在Laravel 5中更改视图文件夹?

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.

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?

  • 写回答

1条回答 默认 最新

  • dpzbzp8728 2015-03-03 23:10
    关注

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

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

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


    Additional Examples

    'paths' => [
    
        // src/MyNamespace/resources
        realpath(base_path('src/MyNamespace/resources')),
    
        // app/resources
        realpath(app_path('resources'))
    
    ],
    
    • You can provide multiple search locations
    • You can use app_path(), base_path(), or neither.
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
编辑
预览

报告相同问题?

手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部