On 04.04.2010, at 19:53, Cameron Manderson wrote:

> Could phptal support a series of namespaced nodes/attributes that trigger 
> code?
> 
> e.g. <php:echo text="Hello World" /> or <example:lorem length="100" /> 
> triggering off php code to convert into a processor command of <?php echo 
> "Hello World"; ?>
> 
> I understand that it might not directly be the purpose of this library, but I 
> want to know whether this sort of extension would be easy to implement. 
> 
> What would be a starting point to implementing this sort of functionality?


TAL—as name implies—is attribute-based. You could add support for php:text or 
example:length attributes, which would work on any element. To do this, look 
how PHPTAL's standard attributes are implemented.

Alternatively, you could implement a pre-filter, which replaces your custom 
elements with PHPTAL code (e.g. <php:echo text=""/> with <tal:block 
tal:content=""/>).

-- 
regards, Kornel




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

Reply via email to