Re: [SMARTY] Re: PHP5: Static methods
| From: | messju mohr | Date: | Mon, 29 Nov 2004 09:00:23 +0000 |
| Subject: | Re: [SMARTY] Re: PHP5: Static methods | ||
| References: | 1 2 3 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-12008@lists.php.net to get a copy of this message | ||
On Mon, Nov 29, 2004 at 09:00:32AM +0100, Dejan Markic wrote:
> Hello!
>
> Yes I know that, that's why I'm asking that :) Any other ideas?!
>
> Maybe something like a function CallStaticMethod($class, $method){} ...
> would that be possible ?
you can register static methods as callbacks for plugins.
like:
$smarty->register_function('Foo_method', array('Foo', 'method'))
where Foo is the classname, method() is the static method.
> Kind regards,
> Dejan
> "Ognyan Bankov" <bankov@metatotem.com> wrote in message
> news:20041126073211.67114.qmail@pb1.pair.com...
> | Dejan Markic wrote:
> | > Hello!
> | >
> | > I don't know if this was discussed already, but ... I just can seem to
> find
> | > a way to call a static method from Smarty in PHP5? Any clues?
> | >
> | > Thanks and kind regards,
> | > Dejan
> |
> | {php}
> | some_class::some_static_method();
> | {/php}
> |
> | should work, but is generally bad idea to have php calls in your templates
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php