Exemple #1
0
 /**
  * Le dados que estão na sessão
  *
  * @param string $key
  * @param mixed $default
  * @return mixed
  */
 public function read($key = null, $default = null)
 {
     if (!$key) {
         return $_SESSION;
     }
     $key = trim($key, '.');
     $s = Hash::get($_SESSION, $key);
     if (!is_array($s)) {
         return !isset($s) ? $default : (trim($s) === '' ? $default : $s);
     }
     return $this->forceBollean($s);
 }
Exemple #2
0
 /**
  * 
  * @param string Chave de navegação
  * @param string Resutado default caso não for achado nenhum resultado referente a navegação
  * @return array|string|null
  */
 public function query($key = null, $default = null)
 {
     if (is_null($key)) {
         return $this->query;
     }
     $s = Hash::get($this->query, $key);
     if (is_null($s)) {
         return $default;
     }
     return $this->forceBollean($s);
 }