amiaoagou 发表于 2010-8-5 19:12:18

如何设置config文件里的配置项。

按照手册上说$this->config->set_item('a','b')没用。怎么办

amiaoagou 发表于 2010-8-5 19:25:40

自己顶啊

jeongee 发表于 2010-8-5 20:50:47

软改?还是硬改啊?
手册上的那个是运行中改变值的吧,不会去改写物理文件的,我发个硬改给你看看吧
function apply_options(){
                $template = "<?phpif !defined('BASEPATH')) exit('No direct script access allowed');\n/*\n|--------------------------------------------------------------------------\n| XX站点设置\n|--------------------------------------------------------------------------\n*/\n\$config\['site_title'] = '{site_title}' ; \n\$config\['site_meta'] = '{site_meta}';\n\$config\['site_keyword'] = '{site_keyword}';\n\$config\['enable_cache'] = {enable_cache} ;\n\$config\['cache_time'] = {cache_time} ;\n/* End of file sys_options.php */\n/* Location: ./application/config/sys_options.php */\n";
                $template = str_replace('{site_title}',$this->input->post("site_title",true),$template);
                $template = str_replace('{site_meta}',$this->input->post("site_meta",true),$template);
                $template = str_replace('{site_keyword}',$this->input->post("site_keyword",true),$template);
                $template = str_replace('{enable_cache}',$this->input->post("enable_cache",true),$template);
                $template = str_replace('{cache_time}',$this->input->post("cache_time",true),$template);
                $template = str_replace('\[','[',$template);
                $template = str_replace('\$','$',$template);
                if(file_put_contents(APPPATH."config/sys_options.php",$template)){
                        $this->show_message("success","站点配置成功");
                }else{
                        $this->show_message("fail","站点配置失败");
                }
      }

配置文件是这样的,这样修改后文件还是下面这个样子的

ici 发表于 2010-8-5 21:26:22

软改?还是硬改啊?
手册上的那个是运行中改变值的吧,不会去改写物理文件的,我发个硬改给你看看吧
配置文 ...
ywqbestever 发表于 2010-8-5 20:50 http://myci.tk/forums/images/common/back.gif
不好意思啊,问点题外话,请问这个是什么编辑器?可否贡献一下配色方案?:-)

lamtin 发表于 2010-8-6 01:02:42

不好意思啊,问点题外话,请问这个是什么编辑器?可否贡献一下配色方案?:-) ...
ici 发表于 2010-8-5 21:26 http://codeigniter.org.cn/forums/images/common/back.gif


    同求。

amiaoagou 发表于 2010-8-6 08:56:47

我也是类似的配色方案,不过字符串是褐色的。我用的是dw5就不知道二楼用的是什么了

jeongee 发表于 2010-8-6 09:24:23

呵呵,这个编辑器是Intype,还是测试的,功能不多哈
http://intype.info/home/
配色方案是他自带的“blackboard”主题,有兴趣的可以下来看看

lamtin 发表于 2010-8-6 09:45:45

呵呵,这个编辑器是Intype,还是测试的,功能不多哈

配色方案是他自带的“blackboard”主题,有兴趣的可以 ...
ywqbestever 发表于 2010-8-6 09:24 http://codeigniter.org.cn/forums/images/common/back.gif


   感谢!

ici 发表于 2010-8-6 18:46:09

来迟了,去试试
:)

hxfsc 发表于 2010-8-13 16:41:21

去试试!
页: [1] 2
查看完整版本: 如何设置config文件里的配置项。