Re: [SMARTY-DEV] register_function('tag', array($obj, 'method'))

From: Date: Mon, 17 Mar 2003 22:58:14 +0000
Subject: Re: [SMARTY-DEV] register_function('tag', array($obj, 'method'))
References: 1  Groups: php.smarty.dev 
Request: Send a blank email to php-smarty-dev+get-972@lists.php.net to get a copy of this message
On Mon, Mar 17, 2003 at 03:29:04PM -0700, Gerard wrote: > > register_function('tag', array($obj, 'method')) funny. i just had the same idea two nights ago. it's on my list for 2.5.1 :) > Feature request :). Don't think it's currently implemented - tried a few > approaches. Similar to PHP functions with callbacks, like usort: > > http://www.php.net/manual/en/function.usort.php > > Reason being, my sites are OO with config info, functions, etc. in objects. > This way those can be accessed directly from the function, rather than > needing globals and so on. > > Would this be possible to implement? Probably just call the object method > directly, or use call_user_func: > > http://www.php.net/manual/en/function.call-user-func.php > > Would also be interested in the other register_ methods supporting it :). yes, especially modifiers. > Gerard

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