本文整理匯總了PHP中CI_Loader::config方法的典型用法代碼示例。如果您正苦於以下問題:PHP CI_Loader::config方法的具體用法?PHP CI_Loader::config怎麽用?PHP CI_Loader::config使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CI_Loader
的用法示例。
在下文中一共展示了CI_Loader::config方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: config
/** Load a module config file **/
public function config($file = '', $use_sections = FALSE)
{
$file == '' and $file = 'config';
if (in_array($file, $this->config->is_loaded, TRUE)) {
return $this->config->item($file);
}
list($path, $file) = Modules::find($file, $this->_module, 'config/');
if ($path === FALSE) {
parent::config($file, $use_sections);
return $this->config->item($file);
}
if ($config = Modules::load_file($file, $path, 'config')) {
/* reference to the config array */
$current_config =& $this->config->config;
if ($use_sections === TRUE) {
if (isset($current_config[$file])) {
$current_config[$file] = array_merge($current_config[$file], $config);
} else {
$current_config[$file] = $config;
}
} else {
$current_config = array_merge($current_config, $config);
}
$this->config->is_loaded[] = $file;
unset($config);
return $this->config->item($file);
}
}
示例2: config
/**
* Loads a config file
*
* @param string
* @param bool
* @param bool
* @return void
*/
public function config($file = '', $use_sections = FALSE, $fail_gracefully = FALSE)
{
// Detect module
if (list($module, $class) = $this->detect_module($file)) {
// Module already loaded
if (in_array($module, $this->_ci_modules)) {
return parent::config($class, $use_sections, $fail_gracefully);
}
// Add module
$this->add_module($module);
// Let parent do the heavy work
$void = parent::config($class, $use_sections, $fail_gracefully);
// Remove module
$this->remove_module();
return $void;
} else {
parent::config($file, $use_sections, $fail_gracefully);
}
}