Lack of Object Support
| From: | Hoffman, Geoffrey | Date: | Tue, 31 Dec 2002 20:00:51 +0000 |
| Subject: | Lack of Object Support | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-6972@lists.php.net to get a copy of this message | ||
Am I missing something here?
<http://smarty.php.net/manual/en/language.variables.objects.php>
says, in
part,
Properties of objects assigned from PHP can be referenced by specifying the
property name after the '->' symbol.
What about object methods? Although perfectly logical, the following gives
an error:
{$object->method()}
A workaround is to assign a property inside the object constructor, which
calls the method to assign the property to the result of the method, then
smarty can just use a property name, but this might not work in all cases.
Wondering if anyone could comment on this?
Geoff