Smarty Help Anyone
| From: | Chad Guilette | Date: | Sat, 13 Oct 2001 04:41:15 +0000 |
| Subject: | Smarty Help Anyone | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-70960@lists.php.net to get a copy of this message | ||
Hey all....I hope someone has some experience with smarty...
here's my situation, code and all...it's kind of messy but it works non-templated...
$dbox_data = get_cat_forum_data($dropbox_count, 1, $user_information[0][3]);
//This is my query that returns a result set an the number of records found into the variable
$dropbox_count
for($loop_box = 0; $loop_box < $dropbox_count; $loop_box++)
{
echo $dbox_data[$loop_box][0] //Print out group label
$category_id2 = $dbox_data[$loop_box][1]; //Assign the unique group number to a
variable
while ($dbox_data[$loop_box][1] == $category_id2) //While the unique_id in the data is = to
the assigned Id we loop
{
<option value="$BOARD_DIR/viewforum.php?c=" . $dbox_data[$loop_box][1] .
"&f=" . $dbox_data[$loop_box][2] . "">----" ..
$dbox_data[$loop_box][3] . "</option>
$loop_box++; //This loop prints out all of the elements as option values underneath
the group header
}
$loop_box--;
}
Basically this code generates a dropbox something like this
GroupValue1
---Value1
---Value2
GroupValue2
---Value1
GroupValue3
---Value1
But how do I template this with Smarty? Up to this point it was pretty smooth sailing...If anyone
has any input or could point me to an example similar to this one it would be appreciated
Chad Guilette