section question

From: Date: Tue, 04 Nov 2003 09:28:29 +0000
Subject: section question
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-10495@lists.php.net to get a copy of this message
Hi everyone, I have started using smarty but i have some troubles with it. can someone pls help me. My question is haw exactly can i use arrays with section. I read the manual but i guess i'm to stupid for it. so this is the loop with makes my array. (certainly this is not in the template) while ($data=mysql_fetch_array($result)){ $news[$news_zahl]["news_id"]=$data[news_id]; $news[$news_zahl]["headline"]=$data[headline]; $news[$news_zahl]["text"]=$data[text]; $news[$news_zahl]["datum"]=$data[datum]; $news[$news_zahl]["autor"]=$data[user]; $news[$news_zahl]["artist"]=$data[artist]; $news_zahl++; } $smarty->assign('news',$news); and here is my section. I tried id a lot of ways but no one works. {section name=news_loop=$news} Headline: {$news[headline]}<br> {/section} i also tried {section name=news_loop=$news} Headline: {$news.headline}<br> {/section} outside of a section this works {$news[0].headline} can pls someone tell me the real syntax. kind regards franco -- CD-TIPP.CH Franco Fallica alter Zürichweg 14 8952 Schlieren tel. u. fax: 079 340 76 42 franco@cd-tipp.ch http://www.cd-tipp.ch Visit our Forum at http://forum.cd-tipp.ch

« previous php.smarty.general (#10495) next »