Try this:

]] $ more test.php

<?php

include_once('PHPTAL.php');

$template = new PHPTAL('test.xml');
$template->set('userInfo', 'Default userInfo info');

try {
    print $template->execute();
} catch(Exception $e){
    print "Error:: {$e->getMessage()}\n";
}

?>


]] $ more test.xml
 
<div id="userInfo" class="userInfo" tal:content="userInfo"
tal:condition="exists:userInfo">
    User information message
</div>

Mikael Andersson wrote:
> Hi
>
> I just ran into something which I'm not sure if I'm doing something
> wrong, there is a bug or if it is the way it is suppose to work.
>
> == This works:
> Controller content:
> $template->userinfo = 'Default userInfo info';
>
> Template content:
>         <div id="userInfo" class="userInfo" tal:content="userinfo"
> tal:condition="exists:userinfo">     
>               User information message
>         </div>
>
> == And this doesn't work:
> Controller content:
> $template->userInfo = 'Default userInfo info';
>
> Template content:
>         <div id="userInfo" class="userInfo" tal:content="userInfo"
> tal:condition="exists:userInfo">     
>               User information message
>         </div>
>
>
> The only difference is the case of the "userInfo" property.
>
> Note that the div always gets rendered, just not its content.
>
> Cheers,
>  Micke
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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

Reply via email to