nesting object calls in template
| From: | Justin Francis | Date: | Fri, 09 Sep 2005 16:59:33 +0000 |
| Subject: | nesting object calls in template | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-13025@lists.php.net to get a copy of this message | ||
I am trying to nest object calls in the template. For example:
{{$obj->getA()->getB()}}
{{foreach from=$obj->getA() item=item}}
The former yields "unknown tag" and the latter translates the "from" argument into $obj."->getA()". I looked in the Smart_Compiler.class code and found that it is explicitly designed so that only one level of object method calls can me made.
Is there a workaround for this? Can anyone shed light on why this was implemented this way?
Justin Francis