laravel 5.3中的echo({!! ... !!}和{{...}})有何不同?

时间:2017-01-03 20:57:15

标签: php laravel laravel-5.3

在laravel 5.3中,有时我使用它:{!! ... !!},有时我会使用它:{{ ... }}

当我使用它时,它很顺利

我想问一下,两者有什么区别?

1 个答案:

答案 0 :(得分:4)

来自Laravel 5.3 doc

Displaying Unescaped Data

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 !!}.