Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

limitation on plugin naming ?

 
Post new topic   Reply to topic    Smarty Forum Index -> Plugins
View previous topic :: View next topic  
Author Message
fidofox
Smarty n00b


Joined: 09 Mar 2007
Posts: 2

PostPosted: Fri Mar 09, 2007 1:55 pm    Post subject: limitation on plugin naming ? Reply with quote

i try to name a plugin by its name and an index within a section:

{section name=idx loop=$buffer}
{html_options name="myname[$smarty.section.idx.index]" ...}
{/section}

Error Message:
"$smarty. is an unknown reference"
Confused
Back to top
View user's profile Send private message
boots
Administrator


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

PostPosted: Sat Mar 10, 2007 3:36 am    Post subject: Reply with quote

I can't understand exactly what you are trying to achieve with that. Can you give a better explanation of your goal?
Back to top
View user's profile Send private message
TGKnIght
Smarty Junkie


Joined: 07 Sep 2005
Posts: 580
Location: Philadelphia, PA

PostPosted: Tue Mar 13, 2007 2:15 pm    Post subject: Reply with quote

Code:

{html_options name="myname`$smarty.section.idx.index`" ...}


http://smarty.php.net/manual/en/language.syntax.quotes.php

Looks like you want to generate multiple <select>s with a loop.. But I'm not entirely sure how you are going to get the data in there without an assign?
_________________
Smarty site with one index.php controller file
Working with MySQL and Smarty
SmartyColumnSort
Custom Smarty Javascript Debug Template
Back to top
View user's profile Send private message Visit poster's website
fidofox
Smarty n00b


Joined: 09 Mar 2007
Posts: 2

PostPosted: Tue Mar 13, 2007 7:48 pm    Post subject: thank's Reply with quote

hello TGKnIght

thanks for the hint.
solution
{section name=idx loop=$buffer}
{html_options name=myname[`$smarty.section.idx.index`] options=$names ...}
{section}

the result values of the select elements are returned as an array named myname[0], myname[1] ...
Very Happy
Back to top
View user's profile Send private message
boots
Administrator


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

PostPosted: Tue Mar 13, 2007 10:56 pm    Post subject: Reply with quote

I think you mean:

Code:
{html_options name="myname[`$smarty.section.idx.index`]" options=$names ...}
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Plugins 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