Re: [SMARTY] Registering plugins inside a class?
| From: | Matthias Mohr | Date: | Thu, 13 Feb 2003 09:47:16 +0000 |
| Subject: | Re: [SMARTY] Registering plugins inside a class? | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-7714@lists.php.net to get a copy of this message | ||
Hi messju,
> On Thu, Feb 13, 2003 at 10:00:26AM +0100, Matthias Mohr wrote:
> > Is it possible to register class-functions as plugin-functions?
.
.
.
> > What's wrong? And how can I fix it?
> > Or isn't it possible, to use class-functions as plugins?
>
> I'm afraid thats not possible. You have to write a wrapper function:
>
> function smarty_modifier_test( $sStr ) {
> return MySmarty::smarty_modifier_test( $sStr );
> }
That's bad news.
I would like to have easy access to all my class-variables and methods inside
the plugin-functions.
If possible, it would be a nice feature for a future version.
Then it would be possible to capsulate the whole smarty application-functionality
in an own class, including all the plugin-functions.
> (BTW, I also tried "MySmarty::smarty_modifier_test" as function-string; same error)
>
> hmm, calls to static methods. i think it would be a nice addition if
> smarty supports that. maybe it is easy to add to the compiler-class, but
> i'm sure it's not supported by now.
That was only my fallback-test. Actually I would like to use it without that class identifier
and also with nonstatic methods...
> (BTW: nice fullname! i like it for ages :-)
Me too :-)
Can it be, that your real name is exactly the same?
now in German:
"mess" ist doch normalerweise auch eine Abkuerzung fuer Matthias, oder?
Nur das "ju" bringe ich nicht unter. Zweitname?
Wo wohnst Du?
with regards,
Matthias
P.S.: hast einen echt witzigen Domaenennamen.