Cml\Config::get PHP Method

get() public static method

获取配置参数不区分大小写
public static get ( string $key = null, string $default = null ) : mixed
$key string 支持.获取多维数组
$default string 不存在的时候默认值
return mixed
    public static function get($key = null, $default = null)
    {
        // 无参数时获取所有
        if (empty($key)) {
            return self::$_content;
        }
        $key = strtolower($key);
        return Cml::doteToArr($key, self::$_content['normal'], $default);
    }

Usage Example

Exemplo n.º 1
0
 /**
  * 使用的缓存配置 默认为使用default_cache配置的参数
  *
  * @param bool|array $conf
  *
  * @throws PhpExtendNotInstall
  */
 public function __construct($conf = false)
 {
     if (!function_exists('apc_cache_info')) {
         throw new PhpExtendNotInstall(Lang::get('_CACHE_EXTENT_NOT_INSTALL_', 'Apc'));
     }
     $this->conf = $conf ? $conf : Config::get('default_cache');
 }
All Usage Examples Of Cml\Config::get