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, 13 Apr 2011 14:45:31 +0100, Ciprian Voicu <pict...@autoportret.ro>
>> 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.
>> <div tal:condition="php: listing.status == 'ACTIVE' && listing.type ==
>> 'PREMIER'">print some good content here</div>
> You could have method like isActivePremier() [or whatever name better
> describes state you're checking for] and use it like this:
> <div tal:condition="listing/isActivePremier">
> If the condition is related to your business rules, then I think that's
> the most appropriate way to do it.
> regards, Kornel Lesiński
> PHPTAL mailing list
PHPTAL mailing list