【发布时间】:2015-05-29 08:22:15
【问题描述】:
我有一个相当复杂的 if-else 语句,我需要帮助。
我只想检查 Session 中是否有值,如果有,则输出一个名为“alert-important”的字符串,它将作为未来更改的挂钩。
不起作用的部分是带有 if 语句的第二部分。
<div class="alert alert-{{ Session::get('flash_notification.level') . ' worksfine ' . if(Session::has('flash_notification.important') ? 'alert-important' : '') }} ">
我得到了错误
"syntax error, unexpected 'if' (T_IF)"
【问题讨论】:
标签: php if-statement laravel