Re: Append
| From: | Mark Dyer | Date: | Fri, 05 Dec 2003 00:22:10 +0000 |
| Subject: | Re: Append | ||
| References: | 1 2 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-10638@lists.php.net to get a copy of this message | ||
Hello,
Thanks for your reply - I still seem tobe confused on this, I have a few
sections like this depending on the status of the listing.
The only difference it the name of the array, ie U and C.
{section name=i loop=$U}
{section name=i loop=$C}
I have this:
************
$data is the retured result from my query.
$tpl->assign('C',array(
"rego" => $data[$i]['rego'],
"series" => $data[$i]['series'],
"invoice_id" => $data[$i]['invoice_id'],
......
));
And again for $tpl->assign('U',array(......));
************
<table width="100%" border="0" cellspacing="1"
cellpadding="0">
{section name=i loop=$C}
<tr><td width="100" align="center" valign="middle">
<form id="editlisting" name="editlisting" method="post"
action="editlisting.{$ext}">
<input type="hidden" name="doaction" value="editlisting">
<input type="hidden" name="order_id" value="{$invoice_id[i]}">
<input type="image" src="{$imagepath[i]}">
</form>
</td>
<td>{$invoice_desc[i]}</td>
<td>{$invoice_options[i]}</td>
<td width="60">$ {if $price[i] == '0.00'}FREE{else} {$price[i]}
{/if}</td>
<td width="20">
<form id="editlisting" name="editlisting" method="post"
action="editlisting.{$ext}">
<input type="hidden" name="doaction"
value="editlisting-account">
<input type="hidden" name="order_id" value="{$invoice_id[i]}">
<input type="image" src="images/but_pay.gif">
</form>
</td>
<td width="20">
<form id="editlisting" name="editlisting" method="post"
action="editlisting.{$ext}">
<input type="hidden" name="doaction" value="deletelisting">
<input type="hidden" name="order_id" value="{$invoice_id[i]}">
<input type="image" src="images/but_del.gif"></td>
</form>
</tr>
{sectionelse}
<tr><td align="center" valign="middle"
colspan="6"><p><span
style="color:blue">No Pending Plates</span></p></td></tr>
{/section}
</table>
Above the simliar but with {section name=i loop=$U}
************
It's the referenceing part I can't figure, I'm new to smarty and I use to
code straight into the php pages. I see this being a great help once I have
it figured.
Thanks.
Mark