src/MvcCore/Ext/Form/Session.php
protected function & getSession () {
		if (isset(self::$allFormsSessions[$this->id])) {
			$sessionNamespace = & self::$allFormsSessions[$this->id];
		} else {
			$sessionClass = self::$sessionClass;
			$toolClass = self::$toolClass;
			$formIdPc = $this->id;
			if (strpos($formIdPc, '-') !== FALSE)
				$formIdPc = $toolClass::GetPascalCaseFromDashed($formIdPc);
			if (strpos($formIdPc, '_') !== FALSE)
				$formIdPc = $toolClass::GetPascalCaseFromUnderscored($formIdPc);
			$namespaceName = '\\MvcCore\\Ext\\Form\\' . ucfirst($formIdPc);
			$sessionNamespace = $sessionClass::GetNamespace($namespaceName);
			// Do not use hoops expiration, because there is better
			// to set up any large value into session namespace
			// or zero value to browser close and after rendered
			// errors just clear the errors.
			//$sessionNamespace->SetExpirationHoops(1);
			$sessionNamespace->SetExpirationSeconds($this->sessionExpiration);
			if (!isset($sessionNamespace->values)) $sessionNamespace->values = [];
			if (!isset($sessionNamespace->csrf)) $sessionNamespace->csrf = [];
			if (!isset($sessionNamespace->errors)) $sessionNamespace->errors = [];
			self::$allFormsSessions[$this->id] = & $sessionNamespace;
		}
		return $sessionNamespace;
	}
protected function & getSession () {
		if (isset(self::$allFormsSessions[$this->id])) {
			$sessionNamespace = & self::$allFormsSessions[$this->id];
		} else {
			$sessionClass = self::$sessionClass;
			$toolClass = self::$toolClass;
			$formIdPc = $this->id;
			if (strpos($formIdPc, '-') !== FALSE)
				$formIdPc = $toolClass::GetPascalCaseFromDashed($formIdPc);
			if (strpos($formIdPc, '_') !== FALSE)
				$formIdPc = $toolClass::GetPascalCaseFromUnderscored($formIdPc);
			$namespaceName = '\\MvcCore\\Ext\\Form\\' . ucfirst($formIdPc);
			$sessionNamespace = $sessionClass::GetNamespace($namespaceName);
			// Do not use hoops expiration, because there is better
			// to set up any large value into session namespace
			// or zero value to browser close and after rendered
			// errors just clear the errors.
			//$sessionNamespace->SetExpirationHoops(1);
			$sessionNamespace->SetExpirationSeconds($this->sessionExpiration);
			if (!isset($sessionNamespace->values)) $sessionNamespace->values = [];
			if (!isset($sessionNamespace->csrf)) $sessionNamespace->csrf = [];
			if (!isset($sessionNamespace->errors)) $sessionNamespace->errors = [];
			self::$allFormsSessions[$this->id] = & $sessionNamespace;
		}
		return $sessionNamespace;
	}
protected function & getSession ( ) { if ( isset ( self :: $ allFormsSessions [ $ this -> id ] ) ) { $ sessionNamespace = & self :: $ allFormsSessions [ $ this -> id ] ; } else { $ sessionClass = self :: $ sessionClass ; $ toolClass = self :: $ toolClass ; $ formIdPc = $ this -> id ; if ( strpos ( $ formIdPc , '-' ) !== FALSE ) $ formIdPc = $ toolClass :: GetPascalCaseFromDashed ( $ formIdPc ) ; if ( strpos ( $ formIdPc , '_' ) !== FALSE ) $ formIdPc = $ toolClass :: GetPascalCaseFromUnderscored ( $ formIdPc ) ; $ namespaceName = '\\MvcCore\\Ext\\Form\\' . ucfirst ( $ formIdPc ) ; $ sessionNamespace = $ sessionClass :: GetNamespace ( $ namespaceName ) ; // Do not use hoops expiration, because there is better // to set up any large value into session namespace // or zero value to browser close and after rendered // errors just clear the errors. //$sessionNamespace->SetExpirationHoops(1); $ sessionNamespace -> SetExpirationSeconds ( $ this -> sessionExpiration ) ; if ( ! isset ( $ sessionNamespace -> values ) ) $ sessionNamespace -> values = [ ] ; if ( ! isset ( $ sessionNamespace -> csrf ) ) $ sessionNamespace -> csrf = [ ] ; if ( ! isset ( $ sessionNamespace -> errors ) ) $ sessionNamespace -> errors = [ ] ; self :: $ allFormsSessions [ $ this -> id ] = & $ sessionNamespace ; } return $ sessionNamespace ; }
Get session namespace reference with configured expiration
and predefined fields `values`, `csrf` and `errors` as arrays.
@return \MvcCore\ISession
Get session namespace reference with configured expiration and predefined fields values csrf and errors as arrays .