Re: [SMARTY] Object access
| From: | Tom Rochester | Date: | Thu, 06 Mar 2003 22:12:57 +0000 |
| Subject: | Re: [SMARTY] Object access | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-8462@lists.php.net to get a copy of this message | ||
messju,
I understand this,
'$obj->method outputs an associative array' should have read '$obj->method returns an associative array'
But my example is not working it is not being assigned to $arr
Thanks,
Tom
messju mohr wrote:
Hello, On Thu, Mar 06, 2003 at 03:43:32PM +1100, Tom Rochester wrote:How does one assign to output of an objects method? The manual states that {$obj->method p1="" assign="output"} should work but it doesn't. Also tried {$obj->method() assign="output"} but this simple outputs the array (ie "Array" is this getting closer?) Specific example: $obj->method outputs an associative array. index.tpl : {$obj->method p1="" assign="arr"} {foreach item="item" from=$arr} {$item}<br/> {/foreach} How can I achieve this functionality? Thanks,not the output of the method is assigned, but the return-value. also the return-value is printed to the page if no "assign=" is given. so your methods should return their output, not echo it. then the output can be assigned optionally. HTH messjuTom