Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

bug in Smarty ? Array's ...

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
Bagroff
Smarty n00b


Joined: 11 May 2003
Posts: 1

PostPosted: Sun May 11, 2003 12:33 pm    Post subject: bug in Smarty ? Array's ... Reply with quote

I have some problems with Smarty 2.5

Array looks like:
$program[i][x][j][time]
$program[i][x][j][name]

doing
... ->assign('program', '$program');


in template
{section name=x loop=$program start=1 max=20}
<DIV><strong class="time">{$program[0][0][x].time}</strong>{$program[0][0][x].name}</DIV>
{/section}

In result, i can see that deduces only two lines. e.g. 2 elements from an array. Actually there of their pieces 40...

If to look Smarty Debug Console with array everything Ok.
In what a problem?

/*
* @link http://smarty.php.net/
* @copyright 2001,2002 ispi of Lincoln, Inc.
* @author Monte Ohrt <monte@ispi.net>
* @author Andrei Zmievski <andrei@php.net>
* @package Smarty
* @version 2.5.0
*/
_________________
www.ikomi.ru
Back to top
View user's profile Send private message
boots
Administrator


Joined: 16 Apr 2003
Posts: 5611
Location: Toronto, Canada

PostPosted: Sun May 11, 2003 12:56 pm    Post subject: Reply with quote

Yes. loop=$program is iterating over only the outermost part of your array. I think you want to use:

loop=20

or better:

loop= $program.key1.key2
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP