Re: [SMARTY] Lack of Object Support

From: Date: Tue, 31 Dec 2002 22:25:01 +0000
Subject: Re: [SMARTY] Lack of Object Support
References: 1  Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-6974@lists.php.net to get a copy of this message
Don't use the ->, but use a . (dot), just as in: {$object.method()} Pieter ----- Original Message ----- From: "Hoffman, Geoffrey" <ghoffman@aztrib.com> To: <smarty-general@lists.php.net> Sent: Tuesday, December 31, 2002 9:00 PM Subject: [SMARTY] Lack of Object Support > 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 > > > -- > Smarty General Mailing List (http://smarty.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > >

« previous php.smarty.general (#6974) next »