laravel 如何在 Laravel5 中更改视图文件夹?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/28848008/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How change view folder in Laravel5?
提问by gsk
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 5 和 AngularJS 开发一个 Web 应用程序。我在客户端使用纯 angularJS 应用程序,并将客户端应用程序文件(视图)放在我的public
文件夹中。
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?
在 Laravel 4 中,我可以更改bootstrap/start.php
文件中的路径。但是在 Laravel 5 中,我看不到该start.php
文件。那么我在哪里更改 Laravel 5 中的配置?
回答by Andy Fleming
See line 16 of config/view.php
(the "View Storage Paths" section)
请参阅第 16 行config/view.php
(“查看存储路径”部分)
'paths' => [
realpath(base_path('resources/views'))
],
So you might change it to realpath(base_path('public/assets/views'))
to be in your public path.
因此,您可以将其更改realpath(base_path('public/assets/views'))
为在您的公共路径中。
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.
- 您可以提供多个搜索位置
- 您可以使用
app_path()
,base_path()
或两者都不是。