smarty-php / smarty

Smarty is a template engine for PHP, facilitating the separation of presentation (HTML/CSS) from application logic.
Other
2.25k stars 709 forks source link

Better support for ternary operator #881

Closed wisskid closed 1 year ago

wisskid commented 1 year ago

Smarty has support for the ternary operator since 2009/2010. But it was never documented. Also, it requires the testing expression to be in parentheses. So this works now:

{($foo) ? $var1 : $var2}

But this will not:

{$foo ? $var1 : $var2}

There is no support for the shorthand ?: version.