Re: IF conditionals

From: Date: Sat, 19 Feb 2000 17:16:35 +0000
Subject: Re: IF conditionals
References: 1 2 3 4 5 6 7 8 9 10  Groups: php.template 
Request: Send a blank email to php-template+get-185@lists.php.net to get a copy of this message
On Sat, 19 Feb 2000, Monte Ohrt wrote: > Currently, IF conditionals include =, !=, <, >, <=, >=. > > What about supporting an alternative syntax, like: > eq, ne, lt, gt, lte, gte Why? > Also, how will the comparisons work if one is a number > and one is a string? > > {{if 122 < "0123"}} > > We could separate the comparison behavior out with the syntax > of the conditional operator, or we could let the php > template engine intelligently decide how variables > are compared with simple rules (I like the second idea, it's easier > for a designer.) The comparisons will be performed using PHP's internal comparison functions which are smart enough to compare "0123" against 122 as a number. -Andrei "In My Egotistical Opinion, most people's C programs should be indented six feet downward and covered with dirt." -- Blair P. Houghton

« previous php.template (#185) next »