mercredi 25 mars 2015

PHP if-else statement throws syntax error unexpected if

I have a rather complicated if-else statement and I need help.


I just want to check if there is a value in the Session and if yes, ouput a string called "alert-important", that is going to function as a hook for changes in the future.


The part that does not work is the second part with the if-statement.



<div class="alert alert-{{ Session::get('flash_notification.level') . ' worksfine ' . if(Session::has('flash_notification.important') ? 'alert-important' : '') }} ">


I get the error



"syntax error, unexpected 'if' (T_IF)"

Aucun commentaire:

Enregistrer un commentaire