another section problem
| From: | Sadri Sahraoui | Date: | Sun, 16 Mar 2003 13:20:54 +0000 |
| Subject: | another section problem | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-8674@lists.php.net to get a copy of this message | ||
Hello
I'm new to Smarty and I have some problems with section
I tried setting up a really simple test script, but it still get a blank output.
here is my array (a result of an sql query)
Here is my php script
$news = getNews();
$tpl ->assign('item', $news);
$tpl ->display('news.tpl');
a var dump on "$news" return this :
array(2) {
[0]=>
array(4) {
["newsID"]=> "3"
["newsSubject"]=> "subject test2"
["newsContent"]=> "content "
["newsImg"]=> "img1.gif"
}
[1]=>
array(4) {
["newsID"]=> "2"
["newsSubject"]=> "subject test1"
["newsContent"]=> "content"
["img"]=> "img1.gif"
}
}
and this is my news.tpl content
{section name=item loop=$front}
ID : $front[item].newsID <br />
subject : $front[item].newsSubject <br />
content : $front[item].newsContent <br />
Img : $front[item].newsImg <br />
{/section}
so each time I get a blank output, can someone tell me what's wrong ??
Thanks in advance for any help
Sadri
--
______________________________________________
http://www.linuxmail.org/
Now with e-mail forwarding for only US$5.95/yr
Powered by Outblaze