Re: [SMARTY] looping through variable names
"Kathleen Krause-Thompson" <[email protected]>
| Newsgroups | gmane.comp.php.smarty.general |
|---|---|
| Message-ID | <45057232A4AC6444B0F9452131E7446E4C11E1@exchange.win2k.tsl.state.tx.us> |
That doesn't quite answer my question. Here is another posting with the php.
<?php
for ($i=1;$i<=$_SESSION['budgetPos'];$i++) {
$str = 'budget' . $i;
if (isset($_SESSION[$str])) {
$smarty->assign($str,$_SESSION[$str]);
}
}
?>
{*smarty*}
<p>Job Title: {$budget1.jobTitle} Percent of Full Time:{$budget1.percentFullTime}</p>
<p>Job Title: {$budget2.jobTitle} Percent of Full Time:{$budget2.percentFullTime}</p>
-----------------------------------------------------------------------------------------------------
How would I setup a loop that will number the array variable names appropriately so that I don't have to code each section?
Job Title: {$budgetx.jobTitle}
I appreciate the advice.
--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php