I've encountered lots of times the need to compare one or more pairs of
values so I used php: modifier, but let's say would be more professional
using some internal tal way instead of php native comparison way.
eg:
div tal:condition=php: listing.status == 'ACTIVE' listing.type ==
'PREMIER'print
Hello :)
It wouldn't work quite as you suggest because of how you use tales but we have
an 'equal' tale as part of Ztal that does pretty much the same thing. You use
it as follows:
div tal:condition=Ztal_Tales_Generic.equal:listing.status,string:ACTIVE
print some good content here/div
The |
On Wed, 13 Apr 2011 14:45:31 +0100, Ciprian Voicu pict...@autoportret.ro
wrote:
I've encountered lots of times the need to compare one or more pairs of
values so I used php: modifier, but let's say would be more professional
using some internal tal way instead of php native comparison way.
For the and operation I've written a modifier that turns all its arguments
into an array of booleans and then uses array_mult() to determine the
outcome for tal:condition.
array_sum could be used for the or-operation ;)
On Apr 14, 2011 2:27 AM, Kornel Lesiński kor...@geekhood.net wrote:
On Wed,