سؤال

Is there an alternative to what I do below :

...
<div class="abc" tal:condition="this/condition1">
    <div class="abc2" tal:condition="this/condition2">
    ...
    </div>
</div>
...

Such as :

...
<div class="abc" tal:condition="this/condition1 AND this/condition2">
...
</div>
...
هل كانت مفيدة؟

المحلول

It's a bit silly, but there's no logical AND in TALES.

You can use php: prefix:

<div tal:condition="php:this.condition1 AND this['condition2']">

but keep in mind that with php: you need to use type-dependent syntax (. for objects, [] for arrays, because / becomes division).

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top