The PHPTAL way would be to create a custom tales modifier , although what
admirau proposes will also work.
On Mon, Feb 2, 2009 at 6:45 PM, admirau <admi...@gmail.com> wrote:
> W dniu 2009-02-02 18:31, Christian Welzel pisze:
>> Hi there,
>> is there a way to inject PHP code into the template during compiiation?
>> I want to make a date: helper for phptal which uses Zend_Date for
>> convertions. But creation of Zend_Date is a bit expensive, so i want to
>> create an instance on the begin of the template file and use it later in
> Create a class and execute method where you need:
> <span tal:content="php: SomeClass::staticMethod()">YYYY-MM-DD</span>
> Use class methods, just replace "->" with dots.
> If you want to inject on the fly, you have to write pre-filter with regex
> or parse DOM.
> Further reading:
> PHPTAL mailing list
PHPTAL mailing list