This still initializes all 300 prefixes, while the goal is to initialize
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:
(this class is a tool to use PHPTAL with F3 PHP framework)
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>
> 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 mailing list