You are here: [smarty] addressing associative array « PHP Programming Language « IT news, forums, messages
[smarty] addressing associative array

Posted by Man-wai Chang on 04/25/07 08:58

Given this assoc array:

$dtl_array[0]['uom_array'][0][0]='key1';
$dtl_array[0]['uom_array'][0][1]='value1';
$dtl_array[0]['uom_array'][1][0]='key2';
$dtl_array[0]['uom_array'][1][1]='value2';
$dtl_array[1]['uom_array'][0][0]='key3';
$dtl_array[1]['uom_array'][0][1]='value3';
$dtl_array[1]['uom_array'][1][0]='key4';
$dtl_array[1]['uom_array'][1][1]='value4';


$sample->assign("dtl_array",$dtl_array);
$sample->display();

How could I create a combobox out of $dtl_array in the templates?
The following does not work:

<select name="aname">
{section name=mm start=0 loop=$dtl_array.0.uom_array step=1}
<option value="{$dtl_array.0.uom_array.mm.0}">
{$dtl_array.0.uom_array.mm.1}
{/section}
</select>

--
iTech Consulting Services Limited
Expert of ePOS solutions
Website: http://www.itech.com.hk (IE only)
Tel: (852)2325 3883 Fax: (852)2325 8288

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация