Re: Nesting
| From: | Justin Patrin | Date: | Wed, 09 Jun 2004 20:27:26 +0000 |
| Subject: | Re: Nesting | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-11440@lists.php.net to get a copy of this message | ||
George Pitcher wrote:
Hi, An appropriate subject considering I work for an organisation named 'Heron'. I am using Smarty with PEAR:DB/MySQL. Some of my pages are lists of reading materials being sent to an agency for permission to scan etc. I present my data as: Course 1 (displaying several items of course information Extract 1 (ditto but for the extract) Extract 2 (ditto but for the extract) Extract 3 (ditto but for the extract) Extract 4 (ditto but for the extract) Course 2 (displaying several items of course information Extract 5 (ditto but for the extract) Extract 6 (ditto but for the extract) Extract 7 (ditto but for the extract) Extract 8 (ditto but for the extract) and so on until all courses and extracts have been handled. So far I've been doing this conventionally by performing nested loops in php, and comparing the Extracts course_id with the pack to see if a new pack loop needs to be started. Its worked well so far. I'm not sure how I should tackle this in Smarty. Any clues or pointers? MTIA George in OxfordUse youre loops to store the data, then pass it into smarty to be rendered. Yes, this means you have to loop twice... -- paperCrane <Justin Patrin>