Skip to the content
Documentation

What is the syntax ???

No ratings yet

What is the synatx, to write an "if"on one line (like the "?" in C) ?
Thanks in adavnce,
D

Comments (1 historical)

Written by readers of the earlier documentation sites, kept as they were.

  1. Re: What is the syntax ???

    Adrien ·

    There is no one line "if". "?:" is not a control structure like "if". "?:" is an operator, the ternary operator.
    The operator in ez you are looking for seems to be "cond".
    PHP:
    $var = $condition?$valueOn:$valueOff;
    Smarty:
    {def $var = cond($condition,$valueOn,true(),$valueOff)}