在 laravel Blade 中使用表单时,此语法有效
{!!Form::token()!!} //with double exclamation mark
<script src="{{ asset('js/register.js')}}" ></script>
最佳答案
来自 Laravel 的文档:
By default, Blade {{ }} statements are automatically sent through PHP's htmlentities function to prevent XSS attacks. If you do not want your data to be escaped, you may use the following syntax:
Hello, {!! $name !!}.
Note: Be very careful when echoing content that is supplied by users of your application. Always use the double curly brace syntax to escape any HTML entities in the content.
{{ $var }}
相当于<?php echo htmlentities($var);?>
{!! $var !!}}
相当于<?php echo $var;?>
{{ }}
大多数情况下,除非有特殊字符自 htmlentities
以来未显示正在逃离他们。只有在这些情况下,您才会使用 {!! !!}}
.https://stackoverflow.com/questions/36240336/