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

Custom Plugin receives string "Array" instead of r

 
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 -> Smarty 3
View previous topic :: View next topic  
Author Message
eposjk
Smarty Rookie


Joined: 07 Oct 2009
Posts: 13

PostPosted: Wed Oct 07, 2009 7:31 pm    Post subject: Custom Plugin receives string "Array" instead of r Reply with quote

Hello!

I have a custom plugin:
Code:
{myinput dropdown="$arrayofoptions"}

$arrayofoptions contains an array.

Inside the PHP plugin code:
For Smarty 2, $params['dropdown'] contains the array. --> correct.
For Smarty 3, $params['dropdown'] contains the string "Array".

When I call the plugin without quotes, it also works with Smarty 3:
Code:
{myinput dropdown=$arrayofoptions}
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Wed Oct 07, 2009 7:49 pm    Post subject: Reply with quote

If you want to pass an array

{myinput dropdown=$arrayofoptions}

is the correct syntax.

It's a bug that Smarty2 does accept {myinput dropdown="$arrayofoptions"}
Back to top
View user's profile Send private message
manuel_
Smarty n00b


Joined: 28 Oct 2013
Posts: 1

PostPosted: Tue Oct 29, 2013 9:52 am    Post subject: Reply with quote

Thx U.Tews! Even though it's now 4 years later, your post helped me out! Smile

Greetings,
Manuel
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 -> Smarty 3 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