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

cycle error, missing argument 3

 
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
Ymez510
Smarty Rookie


Joined: 27 Jul 2010
Posts: 7

PostPosted: Tue Oct 19, 2010 12:58 pm    Post subject: cycle error, missing argument 3 Reply with quote

Hi all,
I was hoping someone can help me with the following problem:
I would like to use the awesome power of the cycle function to alternate a background color in my table.

However I cant get this to work at all.
Very basic what I want is this:
<table>
{foreach from=$nameditems item=nameitem}
<tr style="background-color:{cycle values="#ff0000,#ffff00,#ff00ff"}">
<td>{$nameitem.title}</td>
</tr>
</table>

but instead I get the follownig error 3 times (array contains 3 items):
Warning: Missing argument 3 for smarty_function_cycle(), called in ...FOLDER\templates\_templates_c\%%D9^D9C^D9C18EE3%%newsletter_layout.tpl.php on line 123 and defined in ...FOLDER\smarty\plugins\function.cycle.php on line 44
#ff0000

Any suggestions on whats goig wrong here?
Many thanks in advance.
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Tue Oct 19, 2010 2:22 pm    Post subject: Reply with quote

You should update Smarty3 to RC4.
There was a bug a while ago.
Back to top
View user's profile Send private message
Ymez510
Smarty Rookie


Joined: 27 Jul 2010
Posts: 7

PostPosted: Wed Oct 20, 2010 9:57 am    Post subject: Reply with quote

Oh ok, thanks for the info Smile
oddly enough it appears to function properly on an existing page though.
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