dongyi1982 2015-02-08 05:50 采纳率: 0%
浏览 82
已采纳

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 ?

  • 写回答

2条回答 默认 最新

  • dongyiluan1718 2015-02-09 07:25
    关注

    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.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)
编辑
预览

报告相同问题?

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

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

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

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

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

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

客服 返回
顶部