Nette\Http\Session::hasSection PHP Méthode

hasSection() public méthode

Checks if a session section exist and is not empty.
public hasSection ( $section ) : boolean
Résultat boolean
    public function hasSection($section)
    {
        if ($this->exists() && !self::$started) {
            $this->start();
        }
        return !empty($_SESSION['__NF']['DATA'][$section]);
    }

Usage Example

Exemple #1
0
 /**
  * Checks if a flash session namespace exists.
  * @return bool
  */
 public function hasFlashSession()
 {
     return !empty($this->params[self::FLASH_KEY]) && $this->session->hasSection('Nette.Application.Flash/' . $this->params[self::FLASH_KEY]);
 }