Config::get PHP Method

get() public static method

public static get ( $key )
    public static function get($key)
    {
        if (!self::$config) {
            $config_file = '../application/config/config.' . Environment::get() . '.php';
            if (!file_exists($config_file)) {
                return false;
            }
            self::$config = (require $config_file);
        }
        return self::$config[$key];
    }

Usage Example

 /**
  * Try to retrieve a default setting from a config fallback.
  *
  * @param string $key
  * @param mixed  $default
  *
  * @return mixed config setting or default when not found
  */
 protected function getDefault($key, $default)
 {
     if (!$this->fallback) {
         return $default;
     }
     return $this->fallback->get($key, $default);
 }
All Usage Examples Of Config::get
Config