我在用户控制器中有方法索引
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.
可能未启用刀片模板吗?
答案 0 :(得分:4)
尝试不使用<?php
代码
我希望它有所帮助。