Redaxscript\Request::getSession PHP Méthode

getSession() public méthode

get item from session
Since: 2.2.0
public getSession ( string $key = null ) : string
$key string key of the item
Résultat string
    public function getSession($key = null)
    {
        return self::get($key, 'session');
    }

Usage Example

 /**
  * log
  *
  * @since 2.2.0
  *
  * @return array
  */
 protected static function _log()
 {
     $root = Registry::get('root');
     $fullRoute = Registry::get('fullRoute');
     $recentView = Request::getSession($root . '/recent_view');
     /* handle recent view */
     if ($fullRoute && current($recentView) !== $fullRoute) {
         if (!is_array($recentView)) {
             $recentView = array();
         }
         array_unshift($recentView, $fullRoute);
         Request::setSession($root . '/recent_view', $recentView);
     }
     $output = $recentView;
     return $output;
 }
All Usage Examples Of Redaxscript\Request::getSession