Unexpected tag T_ECHO in inline if

Posted by Lombo on Stack Overflow See other posts from Stack Overflow or by Lombo
Published on 2010-03-25T15:09:02Z Indexed on 2010/03/25 15:13 UTC
Read the original article Hit count: 271

Filed under:

I have something like this in one of my views

<li <?php $isCurrent ? echo 'class="current"' : ''?> >
    <a href="SOME_LINK" class="SOME_CLASS">SOME_TEXT</a>
</li>

This causes a syntax error, unexpected T_ECHO. Changing echo for print solves the issue, but I would like to understand why I cannot use echo.

© Stack Overflow or respective owner

Related posts about php