For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > September 2004 > Help : section & loop









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Help : section & loop
Toorop

2004-09-09, 8:57 am

Hi,

I didn't find how to do a template :

My array :

$my_array=Array
(
[dupont] => Array
(
[id] => 38
[prenom] => titi
[adresse] => DupontTown
Toorop

2004-09-09, 4:01 pm

messju mohr,

[.....]

mm> {section} doesn't work with hash indizes, use {foreach}:

mm> {foreach from=$my_array item=element key=name}
mm> <tr class="{cycle values="TabLigne1,TabLigne2"}">
mm> <td height="21" >{$name}</td>
mm> <td >{$element.prenom}</td>
mm> <td >{$element.adresse}</td>
mm> </tr>
mm> {/foreach}


mm> greetings
mm> messju

Thanks ;-)

--
Toorop
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com