Contao\Session::getInstance PHP Méthode

getInstance() public static méthode

Return the object instance (Singleton)
public static getInstance ( ) : Session
Résultat Session The object instance
    public static function getInstance()
    {
        if (static::$objInstance === null) {
            static::$objInstance = new static();
        }
        return static::$objInstance;
    }

Usage Example

 public function replaceInsertTags($strTag)
 {
     $flags = explode('|', $strTag);
     $tag = array_shift($flags);
     list($strName, $strValue) = explode('::', $tag);
     if ($strName == 'accountmail') {
         $objSession = Session::getInstance();
         $arrData = $objSession->get('ACCOUNTMAIL_PARAMETERS');
         if (isset($arrData[$strValue])) {
             return $arrData[$strValue];
         }
     }
     return false;
 }
All Usage Examples Of Contao\Session::getInstance