Re: Class methods for custom functions
| From: | Ivo Jansch | Date: | Wed, 05 Dec 2001 16:33:18 +0000 |
| Subject: | Re: Class methods for custom functions | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-2145@lists.php.net to get a copy of this message | ||
Hi,
Andrei Zmievski wrote:
On the other hand, suppose I want to call an object method for a certain tag. Then I would be responsible for creating this object. The $obj would then already be available and need not bee serialized.
What do you mean? I couldn't quite understand this sentence.Sorry, we had sinterklaasviering here, which involved some beer. :) No, I mean this: You said the instance of the object would only be available at compiletime and not at runtime. Why? If I do this in my index.php: $myobj = new myobj(); $smarty = new smarty(); $smarty->register_function("sometag", "myobj->mymember"); ... then why would $myobj not be available at runtime? It's always created. You just have to get it from the globals. That's what I meant with the author being responsible for creating an instance of the object. Greetings, Ivo -- Ivo Jansch <ivo@ibuildings.nl> ibuildings.nl BV - information technology http://www.ibuildings.nl