laravel 5中的.blade扩展无法正常工作?
Laravel 5 - Blade Extension Error
I started using laravel 5 recently and its new. I'm using linux ubuntu 14.10.
Here is my code in the file app/Http/routes.php
Route::get('/test',function(){return view('test');});
And I have created the test view here resources/views/test.blade.php
The error is when I use the .blade.php
extension for test file as above the browser window is empty even I don't get any error message.
But when I renamed the file back to test.php
without .blade
it works fine !
I don't get what is happening. And when I used the default files like welcome.blade.php
they work fine too.
I'm really confused. What am I doing wrong ?
Laravel 5 - 刀片扩展错误 h2>
我最近开始使用laravel 5和它的新产品。 我正在使用linux ubuntu 14.10。 p>
这是我的文件app / Http / routes.php中的代码 p>
-
Route :: get('/ test',function(){return view('test');}); code> li> ul>
我在这里创建了测试视图
resources / views / test.blade.php code> p>
错误是我使用
浏览器窗口上面的测试文件的.blade.php code>扩展名是空的,即使我没有收到任何错误信息。 p>
但是当我将文件重命名为
test.php code>没有
.blade code>它工作正常! p>
我不知道发生了什么。 当我使用像
welcome.blade.php code>这样的默认文件时,它们也可以正常工作。 p>
我真的很困惑。 我究竟做错了什么 ? p> div>
If default file welcome.blade.php
works with .blade.php
extension so it looks like there is something in your test
file content that blocks rendering using Blade engine. Try to put this content into welcome.blade.php
and check if it renders properly. If no, then look through your code and find what causes error.
I was having same issue. After changing permission everything now works fine