Re: [PHPTAL] Redefining template variables

2009-02-10 Thread Kornel Lesiński
In template I can access first level variables directly (tal:content="title" />). Is it possible to "switch context" to "parent" object by some redefining so I could access second level variables not by "parent/title" but also direct "title"? My current (ugly) workaround is $data => Object ("

Re: [PHPTAL] Macro in macro?

2009-02-10 Thread Kornel Lesiński
And in php: $tal=new PHPTAL('inc/main.html'); $tal->setTemplate('pages/forum.html'); $tal->setTemplate('pages/forum/main.html'); And it doesn't work - there is only forum, without "inc/main" template :/ What I done wrong? You can't set more than one template at a time. Call to setTemplate()

Re: [PHPTAL] default macro file

2009-02-10 Thread Kornel Lesiński
On 30.01.2009, at 18:09, romtek wrote: On Fri, Jan 30, 2009 at 4:57 AM, Kornel Lesiński > wrote: On 30-01-2009 at 03:13:16 romtek wrote: Assuming that unwinding when handling exceptions is more time consuming than using if/else mechanism, wouldn't it be better to build this ability into

Re: [PHPTAL] Macro in macro?

2009-02-10 Thread Kornel Lesiński
And in php: $tal=new PHPTAL('inc/main.html'); $tal->setTemplate('pages/forum.html'); $tal->setTemplate('pages/forum/main.html'); And it doesn't work - there is only forum, without "inc/main" template :/ What I done wrong? You can't set more than one template at a time. Call to setTemplate()

[PHPTAL] Dynamic allocation of objects inside PHPTAL templates

2009-02-10 Thread romtek
Hi, I've tried to dynamically allocate an object inside a template and gotten errors. The following gets generated in the compiled code: *$ctx->new* GuestList(null, $ctx->event->guestlist_id). The bold part won't work, obviously. It currently seems impossible to do. Is it? Thanks Roman