我可以选择以下方式:
...
<div class="abc" tal:condition="this/condition1">
<div class="abc2" tal:condition="this/condition2">
...
</div>
</div>
...
如:
...
<div class="abc" tal:condition="this/condition1 AND this/condition2">
...
</div>
...
答案 0 :(得分:4)
这有点傻,但在TALES中没有合乎逻辑的AND。
您可以使用php:
前缀:
<div tal:condition="php:this.condition1 AND this['condition2']">
但请注意,使用php:
时,您需要使用与类型相关的语法(.
表示对象,[]
表示数组,因为/
成为分区。 / p>