|
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 |
Budda Smarty Regular
Joined: 19 Apr 2003 Posts: 53 Location: Lymm, Cheshire. UK
|
Posted: Sat Apr 19, 2003 9:32 pm Post subject: Array definition in config files |
|
|
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.... |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Sat Apr 19, 2003 11:45 pm Post subject: |
|
|
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 |
|
ddx Smarty n00b
Joined: 24 Apr 2003 Posts: 2 Location: Shanghai, China
|
Posted: Thu Apr 24, 2003 1:37 am Post subject: |
|
|
but how to define an associate array in a config file? _________________ Hello world! |
|
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
|