rap*_*2-h 16 php laravel laravel-5
我想要渲染一个简单的视图:
public function test()
{
return \View::make('test');
}
Run Code Online (Sandbox Code Playgroud)
我缓存我的配置:
$ php artisan config:cache
Configuration cache cleared!
Configuration cached successfully!
Run Code Online (Sandbox Code Playgroud)
当我在网络浏览器中运行它时,我得到了:
InvalidArgumentException in FileViewFinder.php line 140:
View [test] not found.
in FileViewFinder.php line 140
at FileViewFinder->findInPaths('test', array('/XXXXXX/resources/views')) in FileViewFinder.php line 77
at FileViewFinder->find('test') in Factory.php line 145
at Factory->make('test') in Facade.php line 213
... (framework backtrace)
Run Code Online (Sandbox Code Playgroud)
我清除配置缓存...
$ php artisan config:clear
Configuration cache cleared!
Run Code Online (Sandbox Code Playgroud)
...呈现视图(这是一个简单的HTML视图resources/views/test.blade.php
)
为什么只有没有缓存配置才能工作?
rap*_*2-h 21
当您的机器在流浪者(或其他虚拟环境)上运行并且您php artisan config:cache
没有流浪汉时,它不起作用.你需要在vagrant中运行这个命令吗?问题在于路径路径(流浪者和流浪者的路径不一样).
归档时间: |
|
查看次数: |
5164 次 |
最近记录: |