The logic is that I'm doing many checks and want set or not set products
variable - does not matter it is object or array. I just wanted to write
less code by making PHPTAL template more flexible. So I'll not be worried to
always setup and initialize products object.
On Sat, May 31, 2008 at 2:17 AM, anru chen <[EMAIL PROTECTED]> wrote:
> how about check path first
> tal:conditions = "exists: product/notEmpty"
> then use tal:replace or tal:contents to output actully product?
> so you can push that "and" logic into your business model rather that
> wirte it in a view model
> On Sat, May 31, 2008 at 10:17 AM, Anton Andrievskij <[EMAIL PROTECTED]>
> > The aim is to avoid setting always products.
> > On Sat, May 31, 2008 at 12:03 AM, Christoph Frick <[EMAIL PROTECTED]
> > wrote:
> >> On Fri, May 30, 2008 at 07:04:47PM +0300, Anton Andrievskij wrote:
> >> > How can I specify multiple conditions using AND logical operator and
> >> > php:
> >> > for one of the parts?
> >> >
> >> > I'm trying this but does not works:
> >> >
> >> > tal:condition="exists: products AND php:count(products) == 0"
> >> in python an empty list is also false. iirc phptal works in the same
> >> way. so maybe you are better of by setting products all the time - even
> >> if the list is empty - and then just tal:condition="products"?
> >> --
> >> cu
> >> _______________________________________________
> >> PHPTAL mailing list
> >> PHPTAL@lists.motion-twin.com
> >> http://lists.motion-twin.com/mailman/listinfo/phptal
> > _______________________________________________
> > PHPTAL mailing list
> > PHPTAL@lists.motion-twin.com
> > http://lists.motion-twin.com/mailman/listinfo/phptal
> PHPTAL mailing list
PHPTAL mailing list