而不是不断地执行if语句来查看变量是否在数组中,我想要一个更简单的解决方案。有人知道吗?
@if(isset($content->title))
<h2>{{ $content->title }}</h2>
@endif
或
{{ (isset($content-title)) ? "<h2>$content->title</h2>" : "" }}
我认为编码方式过多。因此,我希望有人知道一个类似以下功能的插件:
{{ @$content->title }}
预先感谢
刀片对此具有特殊的or
关键字: