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

From: Date: Wed, 15 Jan 2003 16:45:11 +0000
Subject: Re: [SMARTY-DEV] objects: one more approach
References: 1  Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-541@lists.php.net to get a copy of this message
Hello, ----- Original Message ----- From: "Monte Ohrt" <monte@ispi.net> To: "Smarty Dev" <smarty-dev@lists.php.net> Sent: Wednesday, January 15, 2003 5:15 PM Subject: [SMARTY-DEV] objects: one more approach > > I'm also wondering how the object parameters should be handled. example: > > {$foo->bar p1="foo" p2=$bar} > > which should happen? > > $foo->bar("foo", $bar); > > or > > $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

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