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.

eg:

<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@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal

Reply via email to