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

FOREACH bug

 
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 -> Bugs
View previous topic :: View next topic  
Author Message
shulya
Smarty n00b


Joined: 12 Jan 2004
Posts: 1
Location: Kiev

PostPosted: Mon Jan 12, 2004 11:48 am    Post subject: FOREACH bug Reply with quote

when I use more than 1 dimention array in foreach - I recive error message

For example:
{%foreach key=$num item=author from=$article.authors%}

I recive PHP error message.

I change Smarty_Compiler.class.php line 1080:
$key_part = "\$this->_tpl_vars[$key] => ";

Thanx
Back to top
View user's profile Send private message Visit poster's website
messju
Administrator


Joined: 16 Apr 2003
Posts: 3336
Location: Oldenburg, Germany

PostPosted: Mon Jan 12, 2004 12:06 pm    Post subject: Re: FOREACH bug Reply with quote

shulya wrote:
when I use more than 1 dimention array in foreach - I recive error message


wrong. when you use variables instead of variable-names as "key" or "value" you receive the message you posted.

use "key=num" not "key=$num".
Back to top
View user's profile Send private message Send e-mail Visit poster's website
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 -> Bugs 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