How To Get Smarty html_radios To Display An ID

Add the parameter label_ids=true. For example:
1 |
{html_radios name="yourName" label_ids=true options=$yourOptions selected=$smarty.request.yourName separator="<br/>"} |
![]() |
Add the parameter label_ids=true. For example:
1 |
{html_radios name="yourName" label_ids=true options=$yourOptions selected=$smarty.request.yourName separator="<br/>"} |
The PHP
1 2 3 4 5 6 7 8 9 |
$sql = 'select * from yourTable'; $result = mysql_query($sql); $rows = array(); while ($row = mysql_fetch_assoc($result)) { $rows[] = $row; } $page = new Smarty(); $page->assign('rows', $rows); $page->show('yourTemplate.php'); |
The Smarty Template
1 2 3 4 5 6 7 8 9 10 11 |
{if $rows} {section name=row loop=$rows} {foreach from=$rows[row] key="Key" item="Value"} <p>{$Key}: {$Value}</p> {/foreach} {/section} {else} <h1>NO ROWS FOUND</h1> {/if} |
PHP number_format($number, 2, ‘.’, ‘,’); SMARTY {$number|number_format:2:”.”:”,”}