Checking for empty variable in PHPTAL condition

Posted by kodziek on Stack Overflow See other posts from Stack Overflow or by kodziek
Published on 2010-06-01T17:53:57Z Indexed on 2010/06/01 20:23 UTC
Read the original article Hit count: 240

Filed under:
|
|

In PHPTAL tal:condition can check is variable empty? Something like that:

< tag tal:condition="var" >Some text< /tag >

but the value of variable is like that:

<?php
$variable = '';
$Tpl->var = $variable;
?>

And it's a problem 'cause PHPTAL that value '' interpreting like not empty value and condition return true. How fix it in PHPTAL side?

© Stack Overflow or respective owner

Related posts about php

Related posts about condition