Re: [SMARTY-DEV] objects: one more approach

From: Date: Wed, 15 Jan 2003 17:31:04 +0000
Subject: Re: [SMARTY-DEV] objects: one more approach
References: 1 2  Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-547@lists.php.net to get a copy of this message
I like this method too, that's what is being prototyped. If you need compatability with an existing object API, you will need to write a wrapper just like you do with registered functions. On Wed, 2003-01-15 at 10:45, Jan Rosier wrote: > > $foo->bar(array('p1' => "foo", 'p2' => $bar), > > $this) > > > > Notice the second one is much like registered functions, all parameters > > are passed as an array in the first argument, and the smarty object > > passed in the second. Maybe we should do this with objects too. > > I vote for the second one. > With an array of params the order of the params in the template doesn't > matter > > Example: > {$foo->bar p1="foo" p2=$bar} is the same as {$foo->bar p2=$bar > p1="foo"} > > And I like that the smarty object is passed too. > > > > > > Monte > > > > > Greetings, > Jan Rosier > > Beware of programmers who carry screwdrivers. - Leonard Brandwein -- Monte Ohrt <monte@ispi.net>

« previous php.smarty.dev (#547) next »