Re: [SMARTY] How to assign associate array into the template in the nested sections?
| From: | Pao-Hsi Huang | Date: | Fri, 10 May 2002 01:40:23 +0000 |
| Subject: | Re: [SMARTY] How to assign associate array into the template in the nested sections? | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-4145@lists.php.net to get a copy of this message | ||
Nope.
My inner loop is a associate array. So what can I do now?
I tried your way but not work.
Best regards,
Pao-Hsi Huang
On Thu, 09 May 2002 13:41:53 -0500
Monte Ohrt <monte@ispi.net> wrote:
> 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:
> >
> >
> >>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
> >>
> >
> >
> >
>
>
>
> --
> 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
>