• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Subfolder in config

#1
Question 
HI! i need help  Smile
I'm have config folder:
/application
 /config
   /forum
   /news
   /members
How to fetch config in (forum, news, members)  Exclamation
Reply

#2
Config sub folders should be for different server environments and not for splitting up actual config files.

Keep them all in one folder, just name them appropriately. You really should need THAT many additional config files, especially not for different users groups or sections of your site.

See: http://www.codeigniter.com/user_guide/li...onfig.html
Reply

#3
(12-19-2015, 12:34 AM)nhatkontum Wrote: HI! i need help  Smile
I'm have config folder:
/application
 /config
   /forum
   /news
   /members
How to fetch config in (forum, news, members)  Exclamation


If you have a config file located at /application/config/forum/new/old/spagetti.php, then you get it like this:


PHP Code:
$this->config->load('forum/new/old/spagetti'); 


I maintain a website that is very large, and has hundreds of config files. You really do need to organize the config files, or they are difficult to find/edit/use.
Reply

#4
(12-21-2015, 09:35 AM)skunkbad Wrote:
(12-19-2015, 12:34 AM)nhatkontum Wrote: HI! i need help  Smile
I'm have config folder:
/application
 /config
   /forum
   /news
   /members
How to fetch config in (forum, news, members)  Exclamation


If you have a config file located at /application/config/forum/new/old/spagetti.php, then you get it like this:


PHP Code:
$this->config->load('forum/new/old/spagetti'); 


I maintain a website that is very large, and has hundreds of config files. You really do need to organize the config files, or they are difficult to find/edit/use.
Tongue thanks you ,it worked !
@mr_pablo my config file very long -> make my site slow.
ex : Controller News need config News, not need other config : (forum, member, ...)
... thanks
Reply

#5
Why would a configuration file make your site slow?
Reply

#6
(12-21-2015, 11:57 PM)Avenirer Wrote: Why would a configuration file make your site slow?

Hi Avenirer! Im know your site and like it, love your tutorials Heart
Now come back to my topic.
In Config contains [ path_views ].
Im convert it (config) to Variable in Views.
AND in Views  load Variable in config. Big Grin
Sorry my english
Reply

#7
Holy mother of Codeigniter... I would ask you why do you access config variables inside your views, but I am afraid...
Reply

#8
ahh i would like change my forum template.
Reply

#9
It looks like you are using Config files incorrectly.

Config should not change that much from the News section to the Forum (unless they use separate databases, even then, you do not need to use sub-folders in the config folder, as that should be for the development environments!)

And as stated above, you really should not access config variables in your views...
Reply


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.