Nette\Http\Session::hasSection PHP Method

hasSection() public method

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

Usage Example

コード例 #1
0
ファイル: Presenter.php プロジェクト: pdostal/nette-blog
 /**
  * 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]);
 }