Discussion:
[SMARTY] Arrays in config files
Pete Morganic
2003-05-13 10:15:54 UTC
Permalink
How do I load an "array" of variables from a config file ?

What I want to do is load the months of the year so I can have a
different section for each lang ...
eg
[welsh]
month[1] = 'Gwener'
month[2] = 'mawrth'

etc
etc

tia
pete
--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Konstantin A. Pelepelin
2003-06-20 08:41:44 UTC
Permalink
Post by Pete Morganic
How do I load an "array" of variables from a config file ?
I wanted to know this, too. I afraid, this is not supported, nor assigning
an associative array from templates. For simple arrays there is a custom
function function.assign_array.php at
http://smarty.php.net/contribs/plugins/

Konstantin A. Pelepelin
--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
messju mohr
2003-06-20 08:50:43 UTC
Permalink
see http://smarty.php.net/manual/en/variable.config.overwrite.php
no associative arrays, though, i'm afraid.
Post by Konstantin A. Pelepelin
Post by Pete Morganic
How do I load an "array" of variables from a config file ?
I wanted to know this, too. I afraid, this is not supported, nor assigning
an associative array from templates. For simple arrays there is a custom
function function.assign_array.php at
http://smarty.php.net/contribs/plugins/
Konstantin A. Pelepelin
--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
alex =)
2003-06-20 15:12:13 UTC
Permalink
Well, I suppose it is possible, since I've been using this for ages even
on sites where I donot use smarty (admin console of a CMS for example).
You have to make use of the ConfigFile.class which is distributed with
smarty. Read in the smarty WiKi how:

http://smarty.incutio.com/?page=SmartyFrequentlyAskedQuestions#config-1


best regards,

alex kulikov
Post by messju mohr
see http://smarty.php.net/manual/en/variable.config.overwrite.php
no associative arrays, though, i'm afraid.
Post by Konstantin A. Pelepelin
Post by Pete Morganic
How do I load an "array" of variables from a config file ?
I wanted to know this, too. I afraid, this is not supported, nor assigning
an associative array from templates. For simple arrays there is a custom
function function.assign_array.php at
http://smarty.php.net/contribs/plugins/
Konstantin A. Pelepelin
--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
--
.::....::.:...::...:..:.:::..:..::..::.::..:.:.

Kulikov Alexey - E-Com Development Consultant

+43 699 1 9228792 | ***@inses.biz
--
Smarty General Mailing List (http://smarty.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
Loading...