|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
mstdmstd Smarty Rookie
Joined: 04 Jan 2013 Posts: 20
|
Posted: Sun Sep 22, 2013 6:52 am Post subject: How to set array calling function plugin |
|
|
Hi,
If I can to set array calling function plugin like :
Code: | {assign var=var_name value=array( 'bar'=>'baz', 'bar2'=>'blah' ) }
...
{url_parameter foo = $var_name }
|
or
Code: | {url_parameter foo = array( 'bar'=>'baz', 'bar2'=>'blah' ) }
|
where url_peremeter is function plugin ?
I tried and recieved syntax error ... |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Sun Sep 22, 2013 8:47 am Post subject: |
|
|
All pluging parameter passed in one array $params where the arttribute name is the array index. In your case $params['foo'] |
|
Back to top |
|
mstdmstd Smarty Rookie
Joined: 04 Jan 2013 Posts: 20
|
Posted: Sun Sep 22, 2013 9:46 am Post subject: |
|
|
Sorry, seems my question was not clear. I mean that the problem is in smarty template, I want to know valid syntax for array passed to plugin. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Sun Sep 22, 2013 2:55 pm Post subject: |
|
|
Sorry I did not see that. Smarty's syntax for arrays is [...]. So the right syntax is
Code: | {url_parameter foo = ['bar'=>'baz', 'bar2'=>'blah'] } |
|
|
Back to top |
|
mstdmstd Smarty Rookie
Joined: 04 Jan 2013 Posts: 20
|
Posted: Mon Sep 23, 2013 4:26 am Post subject: |
|
|
Thanks! |
|
Back to top |
|
|
|
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
|