Hi all:
If the code is: 
[CODE]
<div class="blank_bg" tal:define="book relative/book" tal:condition="php: 
count(book)>0"></div>
[/CODE]

will generate
[RESULT]
<?php
$ctx = $tpl->pushContext() ;
$ctx->book = phptal_path($ctx->relative, 'book', $ctx->__nothrow) ;
if (count($ctx->book)>0):  ;
endif ;
$ctx = $tpl->popContext() ;
?>
[/RESULT]


If the code is:
[CODE]
<div class="blank_bg" tal:define="book relative/book" tal:condition="php: 
count(book)>0">hh</div>
[/CODE]

will generate
[RESULT]
<?php
$ctx = $tpl->pushContext() ;
$ctx->book = phptal_path($ctx->relative, 'book', $ctx->__nothrow) ;
if (count($ctx->book)>0):  ;
?><div class="blank_bg">hh</div><?php
endif ;
$ctx = $tpl->popContext() ;
?>
[/RESULT]

The difference is the later have a non-empty text value.

--
Zou Guangxian



_______________________________________________
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal

Reply via email to