Home > php教程 > php手册 > 解析CodeIgniter自定义配置文件

解析CodeIgniter自定义配置文件

WBOY
Release: 2016-06-06 20:30:53
Original
1158 people have browsed it

本篇文章是对CodeIgniter自定义配置文件进行了详细的分析介绍,需要的朋友参考下

我们有时候在CI框架中需要自定义配置文件,那要怎么处理呢?下面就给你介绍处理的办法。
配置文件config/expert.php

复制代码 代码如下:


/**
* 专家配置文件
*
* @author xxx
* @version $Id: expert.php v 1.0 2012/5/31 14:41:00 xxx $
* @package ask.xxx.com
* @copyright 1997-2012
*/
// 专家ID
$config['expertid'] = array('0' => '124', '1' => '81', '2' => '136');
?>


获取配置数据示例
$this->config->load('expert', TRUE);
$expertid = $this->config->item('expertid', 'expert');
,香港空间,美国空间,网站空间
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template