[PHPTAL] true:

Jonathan Vanasco phptal at 2xlp.com
Mon Nov 13 17:16:27 CET 2006


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
| - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
- - - - - - - - - - - - - - - -





More information about the PHPTAL mailing list