Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

inconsistent handling of function passed to register_functio

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
kubalaa
Smarty n00b


Joined: 23 Jul 2004
Posts: 1

PostPosted: Fri Jul 23, 2004 8:22 pm    Post subject: inconsistent handling of function passed to register_functio Reply with quote

The simplest way to illustrate the problem is to change a call to register_function from passing a function name to an array (ala array(&$object, "method")), or the other way. The template will get a fatal error trying to use that function unless you recompile it.

The deeper problem is that you cannot expect to compile in the name of a dynamically-registered function. Some of my code dynamically generates new functions with unique names, and the name of the function may change from run to run.
Back to top
View user's profile Send private message
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Sat Aug 14, 2004 8:57 pm    Post subject: Re: inconsistent handling of function passed to register_fun Reply with quote

kubalaa wrote:
The deeper problem is that you cannot expect to compile in the name of a dynamically-registered function. Some of my code dynamically generates new functions with unique names, and the name of the function may change from run to run.


if you do that, register a static function and inside that dispatch to your dynamically changing functions.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Bugs All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP