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

how to set an array in conf file

 
Post new topic   Reply to topic    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
D‚nÍl
Smarty n00b


Joined: 27 Dec 2007
Posts: 4

PostPosted: Thu Dec 27, 2007 11:11 am    Post subject: how to set an array in conf file Reply with quote

Hi,

I'm using smarty to make one my project easier to develop, in particular ,obviously, regarding templates.

But I have a problem. I need to set an array in the .conf file, but I don't know how I can do this. I tried to search, but I haven't found an answer....can you help me?

thanks in advance
Back to top
View user's profile Send private message
D‚nÍl
Smarty n00b


Joined: 27 Dec 2007
Posts: 4

PostPosted: Fri Jan 04, 2008 6:36 pm    Post subject: Reply with quote

no one can help me?
Back to top
View user's profile Send private message
no0n
Smarty Rookie


Joined: 31 Aug 2007
Posts: 21

PostPosted: Fri Jan 04, 2008 6:46 pm    Post subject: Reply with quote

How about :

someArray = "first,second,third"

And split on ',' ?
Back to top
View user's profile Send private message
boots
Administrator


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

PostPosted: Fri Jan 04, 2008 7:54 pm    Post subject: Reply with quote

http://www.smarty.net/manual/en/variable.config.overwrite.php
Back to top
View user's profile Send private message
D‚nÍl
Smarty n00b


Joined: 27 Dec 2007
Posts: 4

PostPosted: Mon Jan 07, 2008 6:50 pm    Post subject: Reply with quote

thanks no0n but someArray = "first,second,third" defines a string variable containing first,second,third but not an array Crying or Very sad

I'm going to try the $config_overwrite alternative...

There is an unaswared FAQ about defining config variable as an array...I thought there isn't a solution...but now I know that and I say THANKS FOR THE HELP Wink

PS but with this solution if I would to define an associative array or multidimensional array, there is a way to do this?
Pease don't ban me for so many questions Laughing
Back to top
View user's profile Send private message
boots
Administrator


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

PostPosted: Mon Jan 07, 2008 9:16 pm    Post subject: Reply with quote

Hi.

My link shows how to create a indexed array. Associative arrays in config files are not supported.
Back to top
View user's profile Send private message
D‚nÍl
Smarty n00b


Joined: 27 Dec 2007
Posts: 4

PostPosted: Fri Jan 11, 2008 3:42 pm    Post subject: Reply with quote

thanks boots Wink
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> General 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