[PHPTAL] PHPTAL Expression modifier registration
Moritz Bechler
mbechler at eenterphace.org
Thu Oct 26 16:05:45 CEST 2006
Hi,
I obviously used the wrong address to post to the list so I started to
work on a patch that provides me with what I need for some project of mine
without comments of your side.
My first mail:
> I'm considering to use PHPTAL as template engine for some project of
> mine. So far I can see this now everything works pretty much the way I
> like it to work except to one thing: the definition of custom expression
> modifiers.
> I make heavy usage of object oriented programming so having the handler
> functions for expression modifiers in global function is not as
> beautiful as i liked it. I saw a patch (that might be already included -
> did't test it yet) on the mailinglist that allowed the usage of class
> methods but I don't like that either it produces long and very static
> templates. Did you think about some kind of registration for these
> expression modifiers?
> Let's say a global registry (won't need a kind of
> configuration file). The developer will have to make sure that all
> (custom) handlers are registered when the template is parsed/compiled -
> I think that wouldn't cause any trouble and even backwards compatibility
> should be no real problem. Is there any obvious reason not to have this?
> What do you think about it?
I'm sorry I didn't care much about your coding standards ,documentation
and tests but I can do this if you want me to. Also I'm not pretty sure
about my placing of files in your directory hierarchy, please correct my
when I'm wrong. I have attached a patch (against a TRUNK of some weeks
ago, but seems to be the same as now) which includes the following
changes:
+ Implementation of a basic (global) registry (PHPTAL_TalesRegistry) for
tales expression modifiers. (Including checks for correct callbacks) +
Backward compatible (as long no phptal_tales_* functions were placed in
the compiled templates) changes in phptal_tales() which include support
for the registry mentioned above. (Maybe one should remove the support for
the other object-oriented approach if deciding to use mine)
+ Moved all internal tales to a class named PHPTAL_TalesInternal and
implemented semi-automatic registration of them.
Please tell me what you think about the idea in general and the patch.
Moritz Bechler
-------------- next part --------------
A non-text attachment was scrubbed...
Name: tales_registry.patch
Type: text/x-patch
Size: 24859 bytes
Desc: not available
Url : http://lists.motion-twin.com/pipermail/phptal/attachments/20061026/98047085/tales_registry.bin
More information about the PHPTAL
mailing list