|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
alxgorlov Smarty n00b
Joined: 25 Jun 2007 Posts: 1
|
Posted: Mon Jun 25, 2007 10:28 am Post subject: Access methods of a class |
|
|
From FAQ:
Quote: | Q: How can I access methods of a class that was returned by an assigned object? For example: {$obj->getMemberObj()->foo()} . I tried to {assign} $obj->getMemberObj() first but that didn't work either.
A: You can't, at least not in PHP4. This is a limitation of the language. In PHP5 this has been solved. Instead, assign the variable first, and then call the function.
{assign var='object' value=$obj->getMemberObj()}
Foo is now: {$object->foo()}
Top |
I use PHP5. If it's posible how to access methods of a class directly? |
|
Back to top |
|
boots Administrator
Joined: 16 Apr 2003 Posts: 5611 Location: Toronto, Canada
|
Posted: Mon Jun 25, 2007 4:59 pm Post subject: |
|
|
Sorry, method derefrencing is not supported. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|