#if

Conditional output

Examples :

if / end :

    #if ( $v == 1 ) equals 1 #end

    #if ( $v == 1 )
    equals 1
    #end

if / else / end :

    #if ( $v == 1 ) equals 1 #else not equals 1 #end

    #if ( $v == 1 )
    equals 1
    #else
    not equals 1
    #end

if / elseif / else / end :

    #if ( $v == 1 )
    equals 1
    #elseif ( $v == 2 )
    equals 2
    #else
    other
    #end

Operator Name Symbol Text Symbol Example
Equals Number == eq #if( $foo == 42 )
Equals String == eq #if( $foo == "bar" )
Object Equivalence == eq #if( $foo == $bar )
Not Equals != ne #if( $foo != $bar )
Greater Than > gt #if( $foo > 42 )
Less Than < lt #if( $foo < 42 )
Greater Than or Equal To >= ge #if( $foo >= 42 )
Less Than or Equal To <= le #if( $foo <= 42 )
Boolean NOT ! not #if( !$foo )
Logical AND && and #if( $foo && $bar )
Logical OR || or #if( $foo || $bar )

NB :