刀片模板语法错误,意外'}' - laravel 5

时间:2015-04-09 11:00:10

标签: php laravel laravel-4 laravel-5

我在用户控制器中有方法索引

public function index()
{
    return view('users.profile')->with('title', 'ayman');
}

在users / profile.blade.php文件中:

<?php
 {{ $title }}

在route.php中

Route::get('profile', 'users\UserController@index');

运行页面时:http://localhost:8080/public/profile

我收到了这个错误

 1/1 FatalErrorException in a5c4244e0ec8b952d428220fcdcd0d45 line 2: syntax error, unexpected '}' 

我正在使用Laravel 5.

可能未启用刀片模板吗?

1 个答案:

答案 0 :(得分:4)

尝试不使用<?php代码

我希望它有所帮助。