This still initializes all 300 prefixes, while the goal is to initialize them either: 1) on-demand, or 2) by declaring prefixes in page / view / controller classes - for prefixes which are unique for particular template usage
However I can see that each prefix registered is not more then an entry in PHPTAL's array with some minimal processing, so maybe it does not worth it to do 1) or 2), and it's enough to register them all together. Currently I have found the way to do it without cracking phptal. Here is what I have so far and it works perfectly: http://pastie.org/2059222 (this class is a tool to use PHPTAL with F3 PHP framework) Regards, Anton Andriyevskyy Business Automation & Web Development 2011/6/5 Kornel Lesiński <kor...@geekhood.net> > On Fri, 03 Jun 2011 08:12:19 +0100, Anton Andriyevskyy <x.meg...@gmail.com> > wrote: > > Currently in PHPTAL I don't think it's possible, but you could easily > modify PHPTAL to do it. > > See PHPTAL_TalesRegistry->findUnregisteredCallback — loop through your > classes there. > > > Alternatively, you could register all prefixes, but only before template is > compiled. To do it, extend PHPTAL class and: > > function parse() > { > // register 300 prefixes here :) > return parent::parse(); > } > > This way you won't get performance hit at run time. > > -- > regards, Kornel Lesiński > > _______________________________________________ > PHPTAL mailing list > PHPTAL@lists.motion-twin.com > http://lists.motion-twin.com/mailman/listinfo/phptal >
_______________________________________________ PHPTAL mailing list PHPTAL@lists.motion-twin.com http://lists.motion-twin.com/mailman/listinfo/phptal