【问题标题】:error in blade template syntax error, unexpected '}' - laravel 5刀片模板语法错误中的错误,意外的'}' - laravel 5
【发布时间】:2015-04-09 11:00:10
【问题描述】:

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

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。

刀片模板可能未启用吗?

【问题讨论】:

  • 尝试不使用
  • 感谢作品。请在上面添加作为答案以将其标记为正确:)

标签: php laravel laravel-4 laravel-5


【解决方案1】:

尝试不使用&lt;?php 标签

希望对你有帮助。

【讨论】:

    猜你喜欢
    • 2018-04-26
    • 2014-12-03
    • 2014-06-01
    • 2021-09-16
    • 2015-10-24
    • 2014-11-08
    • 2016-02-09
    • 2017-07-15
    • 2015-08-18
    相关资源
    最近更新 更多