[PHPTAL] Re: Dynamic allocation of objects inside PHPTAL templates

2009-02-17 Thread romtek
On Tue, Feb 10, 2009 at 2:55 PM, romtek rom...@gmail.com wrote: 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.

Re: [PHPTAL] Re: Dynamic allocation of objects inside PHPTAL templates

2009-02-17 Thread Iván -DrSlump- Montes
I would think so. You can however work around it by using a factory pattern, that is, a function wich returns an instance of the object. ie: function GuestListFactory( $param1, $param2 ){ return new GuestList( $param1, $param2 ); } regards, Ivan On Tue, Feb 17, 2009 at 10:35 AM, romtek