Re: Class methods for custom functions
| From: | Andrei Zmievski | Date: | Wed, 05 Dec 2001 15:36:01 +0000 |
| Subject: | Re: Class methods for custom functions | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-2141@lists.php.net to get a copy of this message | ||
On Wed, 05 Dec 2001, Ivo Jansch wrote:
> Why this serialize/unserialize and call_user_func? Can't you just
> compile it to:
>
> $obj->$func(..) ?
Because you can't store the object in the compiled template except in
serialized form? Look at compile_custom_tag() implementation:
return "<?php $function(array(".implode(',', (array)$arg_list)."),
\$this); if(\$this->_extract) { extract(\$this->_tpl_vars);
\$this->_extract=false; } ?>";
Even if you parse the closure into the object and the method name, that
object only exists while compiler is running.
-Andrei
Linux is like living in a teepee.
No Windows, no Gates, Apache in house.
- Usenet signature