Beispiel #1
0
 /**
  * Get a certain value from the session based on the key/path.
  *
  * @access public
  * @param string $key
  * @return mixed
  */
 public function get($key)
 {
     return Set::extract($_SESSION, $key);
 }
Beispiel #2
0
 /**
  * Grab a value from the current configuration.
  *
  * @access public
  * @param string $key
  * @return string|null
  * @static
  */
 public static function get($key)
 {
     if ($key == 'debug') {
         $key = 'Debug.level';
     }
     return Set::extract(static::$__config, (string) $key);
 }
Beispiel #3
0
 /**
  * Check to see if a value exists in the POST/GET data, if so escape and return.
  *
  * @access public
  * @param string $model
  * @param string $field
  * @return string
  */
 public function value($model, $field)
 {
     $data =& App::$data;
     $value = Set::extract($data, $model . '.' . $field);
     if (!empty($value)) {
         return is_array($value) ? $value : htmlentities($value, ENT_COMPAT, App::charset());
     } else {
         $data = Set::insert($data, $model . '.' . $field, null);
         return null;
     }
 }
Beispiel #4
0
 /**
  * Return a full detailed list of all registered objects organized by their slug.
  * Can filter down the architecture by supplying a dot path notation.
  *
  * @access public
  * @param string $path
  * @return array
  * @static
  */
 public static function listMapping($path = null)
 {
     return empty($path) ? static::$__mapping : Set::extract(static::$__mapping, (string) $path);
 }
Beispiel #5
0
 /**
  * Return the current configuration (single or all) from the class.
  *
  * @access public
  * @param string $key
  * @return array
  */
 public final function getConfig($key = null)
 {
     return Set::extract($this->_config, $key);
 }