Thanks for the answer.
I didn't use Ztal until now, even if I've proposed to myself to do it. But
in the next project I will be involved it is sure I will do it. I followed
the discussions about Ztal and seems to me quite intuitive, at least for me.
Anyway, I like very much the pair PHPTal and Zend Framework made.
I agree also for the native PHPTal way, only that I thought of a shorter way
of doing the same thing.
On Wed, Apr 13, 2011 at 5:04 PM, Robert Goldsmith <rgoldsm...@names.co.uk>wrote:
> 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 | symbol can be considered an 'or' where if the first statement fails
> or returns false the next statement is attempted and so on. The Ztal equal
> tale does support chaining in this way. However, there is no 'built-in'
> support for 'and' - generally you just need to put a second condition block
> within the first:
> tal:condition="Ztal_Tales_Generic.equal:listing/status,string:ACTIVE" >
> tal:condition="Ztal_Tales_Generic.equal:listing/type,string:PREMIER" >
> print some good content here
> Obviously the tales packaged as part of Ztal are completely useable without
> needing to use the rest of Ztal :)
> On 13 Apr 2011, at 14:45, Ciprian Voicu 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>
> > it will be something more likely to use:
> > <div tal:equal="listing/status 'ACTIVE'; listing/type 'PREMIER'">print
> some good content here</div>
> > Another question.
> > I use pipe (`|`) also in tal:condition to check if at least one of the
> expressions is true, but what if we would have some way to check if all
> conditional expressions are true?
> > Did I understood wrong some PHPTal principles having these requests?
> > Ciprian Voicu
> > --
> > Ciprian Voicu
> > Modernism.RO
> > _______________________________________________
> > PHPTAL mailing list
> > PHPTAL@lists.motion-twin.com
> > http://lists.motion-twin.com/mailman/listinfo/phptal
> PHPTAL mailing list
PHPTAL mailing list