Re: Calling object methods from smarty variables
| From: | Andrei Zmievski | Date: | Wed, 27 Feb 2002 16:56:02 +0000 |
| Subject: | Re: Calling object methods from smarty variables | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-2868@lists.php.net to get a copy of this message | ||
On Wed, 27 Feb 2002, David Heinemeier Hansson wrote:
> It doesn't seem to be possible to call {$person->getFullName()}. Is
> there a work-around to this? The piece below works just fine (the method
> returns an array of error messages), so I found it strange that the
> simpler version didn't work.
>
> {foreach from=$errors->getAllErrorMessages() item=errorMessage}
> <li>{$errorMessage}</li>
> {/foreach}
>
> I read through the archives and saw a reference [1] to some work-around
> in the CVS repository, but I haven't been able to find this repository.
> Does anyone has the work-around or can tell me how to access the
> repository?
No, there are no plans to make calling object methods from templates
possible. The reason 'from' works is a side-effect of the compiler, it
certainly wasn't intended this way.
-Andrei
* Anything will fit if you push hard enough. *