[PHPTAL] true:

Levi Stanley levi at eneservices.com
Mon Nov 13 17:59:52 CET 2006


Interesting discussion.  So basically if I wanted to do something using 
true: I would do something like this:

<table id='dynamic_stats_table'>
<!-- Title bar of dynamic stats table -->
<tr>
   <td tal:repeat="stats_column stats_title" tal:condition="true: 
stats_column/hasAccessToView" tal:content="stats_content/getTitle"/>
</tr>
<!-- Now show the data -->
<tr tal:repeat="stats_row stats_info">
   <td tal:repeat="stats_column stats" tal:condition="true: 
stats_column/hasAccessToView" 
tal:content="stats_row/getData/${stats_content/getTitle}"/>
</tr>
</table>

Actually, was looking for something like that, ended up using a php: 
which I know I will have to fix later if I were going to go to Petal, or 
some other TAL implementation.  Is there another way to do this without 
using php_tales, php: or true:  Just interested in knowing.

Best regards,
Levi

Jonathan Vanasco wrote:
>
> On Nov 13, 2006, at 5:17 AM, lbedubourg wrote:
>
>> I'll check that during this week.
>
> right now i'm just doing:
>
> function phptal_tales_true($expression, $nothrow)
> {
>     return phptal_tales($expression, $nothrow);
> }
>
>> Try <div tal:condition="exists: Messages"> to check if a variable is
>> defined or not.
>
> works very well..
>
> is there a way to do something like:
>
> function phptal_tales_true($expression, $nothrow)
> {
>     if ( phptal_tales_exists($expression, $nothrow)
>     {
>         return phptal_tales($expression, $nothrow);
>     }
>     return 0;
> }
>
> which would make the behavior more inline with other TAL 
> implementations ?  ( Perl's Petal and Template TAL, Pythons SimpleTAL, 
> and ZPT all suppress an error by default if you do:
>
>     <tal:condition="true: var_that_does_not_exit" tal:repeat="var 
> var_that_does_not_exist"/>
>
> I mostly use the perl and python implementations, so I'm trying to get 
> PHPtal to work as closesly like them as possible so my templates stay 
> portable.
>
>
>
>
> // Jonathan Vanasco
>
> | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
> - - - - - - - - - - - - - - - -
> | FindMeOn.com - The cure for Multiple Web Personality Disorder
> | Web Identity Management and 3D Social Networking
> | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
> - - - - - - - - - - - - - - - -
> | RoadSound.com - Tools For Bands, Stuff For Fans
> | Collaborative Online Management And Syndication Tools
> | - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
> - - - - - - - - - - - - - - - -
>
>
>
> _______________________________________________
> PHPTAL mailing list
> PHPTAL at lists.motion-twin.com
> http://lists.motion-twin.com/mailman/listinfo/phptal
>
> !DSPAM:1,45589e63293326599185008!
>




More information about the PHPTAL mailing list