【发布时间】:2016-09-02 13:19:22
【问题描述】:
我正在尝试从 Laravel 附加 Blade 语法,但无法让浏览器理解 Blade。当我从我的 js 文件中附加 Blade 语法时,它会将代码输出到页面上。
// this is my code..
$("#"+Current_box).append("@if ($errors->has('testing'))<span class='help-block'><strong>{{ $errors->first('testing') }}</strong></span>@endif")
它会将这个输出到页面上:
@if ($errors->has('testing'))
{{ $errors->first('testing') }}
@endif
【问题讨论】:
-
你没有“让浏览器理解刀片”。您渲染刀片模板并返回渲染的 html。
标签: javascript php jquery laravel-5.2 laravel-blade