PDA

View Full Version : can you have multiple evaluation in a template conditional?


TalkVirginia
10-13-2009, 10:43 PM
I have the following php code that I'm trying to convert into a template conditional. Can this be done?



if ($firstGameTime !== $cutoffDateTime && !$firstGameExpired)
{
//show something
}



I tried to convert it like this but the style manager thinks it's missing the beginning <if>


<if condition == "$firstGameTime != $cutoffDateTime && !firstGameExpired">
<div id="firstGame" class="countdown"></div>
</if>

Lynne
10-13-2009, 11:39 PM
You would write it as (only a single = after the condition):
<if condition="$firstGameTime != $cutoffDateTime && !firstGameExpired">
<div id="firstGame" class="countdown"></div>
</if>

Adrian Schneider
10-14-2009, 05:47 AM
<if condition="$firstGameTime !== $cutoffDateTime && !$firstGameExpired">

Lynne
10-14-2009, 03:40 PM
Interesting...... here are the differences in the two operators from this page (http://php.net/manual/en/language.operators.comparison.php):

$a != $b Not equal TRUE if $a is not equal to $b.
$a !== $b Not identical TRUE if $a is not equal to $b, or they are not of the same type.