[PHPTAL] Implementing phptal modifiers as static methods in
x.meglio at gmail.com
Fri Jun 3 09:12:19 CEST 2011
>From the source code I can see that I'm able to use modifiers like
if my class named className implements PHPTAL_Tales.
What is bad here is that:
1. I have multiple classes implementing phptal modifiers (for better
2. Their names are long
*Q1.* Is it possible to register class names to be looked for modifier
So I do not have to write tal:content="className.modifierMethodName:
expression" but only "modifierMethodName: expression".
I found that I can use PHPTAL_TalesRegistry->registerPrefix(), but if I have
300 modifiers and I need only
few ones on each template - I would not register all them at once. Makes
*Q2.* Can this [potential] dynamic search for modifier implementors also
work with php class autoloading?
So the final usage would be something like:
U1. Declare calls with static methods, maybe even phptal_tales_<modifier>
U3. Use my modifiers in templates, having php autoload in place.
Business Automation & Web Development
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the PHPTAL