简体   繁体   English

在CodeIgniter中加载配置并设置配置值

[英]Loading Config and Setting a Config Value in CodeIgniter

I try to create application with back-end and frond-end. 我尝试用后端和前端创建应用程序。 The folder structure as follows(only show config file position to explain problem) 文件夹结构如下(仅显示配置文件位置以解释问题)

+root
|-admin
|-application
  |—backend
    |—config
      |—config.php
  |—frontend
    |—config 
      |—config.php
|-system

Using back-end admin panel I try to change config value in both back-end and frond-end config.php value. 使用后端管理面板,我尝试更改后端和前端config.php值中的配置值。 But I fail to change it in front-end config.php file. 但是我无法在前端config.php文件中更改它。 I don't need database based solution for this. 我不需要基于数据库的解决方案。

Reading the documentation I got this: 阅读文档,我得到了:

Note: CodeIgniter always tries to load the configuration files for the current environment first. If the file does not exist, the global config file (ie, the one in application/config/) is loaded. This means you are not obligated to place all of your configuration files in an environment folder − only the files that change per environment.

So based on that information, I think the problem is when you are calling it, maybe a problem with your path. 因此,基于这些信息,我认为问题出在您调用它时,也许是您的路径有问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM