Re: [SMARTY] How to assign associate array into the template in the nested sections?
| From: | Monte Ohrt | Date: | Thu, 09 May 2002 18:41:53 +0000 |
| Subject: | Re: [SMARTY] How to assign associate array into the template in the nested sections? | ||
| References: | 1 2 3 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-4133@lists.php.net to get a copy of this message | ||
The inner loop must be determined by the number of elements in fields, yes? fields is an array within the member array, so you must reference it as so.
Pao-Hsi Huang wrote:
Thanks a lot. But how do you know this skill ? I didn't found any documentation on any Smarty & PHP4 manual?! Best regards, Pao-Hsi Huang On Thu, 09 May 2002 09:10:24 -0500 Monte Ohrt <monte@ispi.net> wrote:-- Monte Ohrt <monte@ispi.net> Director of Technology, ispi Inc.Try this in your inner loop: {section name=fid loop=$member[id].fields} Pao-Hsi Huang wrote:For my example ( don't work ), {section name=id loop=$member} {section name=fid loop=$fields} {$member[id].$fields[fid]} <br> {/section} <p> {/section} I have a member's data array $member[], each row has its own associate array such as $member[0]['username']. But I can't put this into templates in the nested sections and always display error message. Does anyone know how to solved this problem? Thanks! Best regards, Pao-Hsi Huang-- Monte Ohrt <monte@ispi.net> Director of Technology, ispi Inc. -- Smarty General Mailing List (http://smarty.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php