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

Array definition in config files

 
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 -> Feature Requests
View previous topic :: View next topic  
Author Message
Budda
Smarty Regular


Joined: 19 Apr 2003
Posts: 53
Location: Lymm, Cheshire. UK

PostPosted: Sat Apr 19, 2003 9:32 pm    Post subject: Array definition in config files Reply with quote

Could it be possible to define an array in a .conf file please.
It would be good to just provide a comma seperated list of values in the .conf file, such as:

myArray = "one", "two", "three", "four"

Then in the actual Smarty template this variable could be passed to various plugins to build HTML select lists etc.

Uses? Well specifying credit/debit cards which are accepted in a shop would be useful. Obviously a hundred other uses.... Wink
Back to top
View user's profile Send private message Visit poster's website Yahoo Messenger MSN Messenger
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7368
Location: Lincoln Nebraska, USA

PostPosted: Sat Apr 19, 2003 11:45 pm    Post subject: Reply with quote

set $smarty->config_overwrite = false;

Then you can make arrays in config files like this:

Code:

myvar = val1
myvar = val2
myvar = val3
...


Then when you load the config file, #myvar# will be an array of the given values.

Monte
Back to top
View user's profile Send private message Visit poster's website
ddx
Smarty n00b


Joined: 24 Apr 2003
Posts: 2
Location: Shanghai, China

PostPosted: Thu Apr 24, 2003 1:37 am    Post subject: Reply with quote

but how to define an associate array in a config file?
_________________
Hello world!
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
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 -> Feature Requests 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