yii\web\CookieCollection::get PHP Метод

get() публичный Метод

Returns the cookie with the specified name.
См. также: getValue()
public get ( string $name ) : Cookie
$name string the cookie name
Результат Cookie the cookie with the specified name. Null if the named cookie does not exist.
    public function get($name)
    {
        return isset($this->_cookies[$name]) ? $this->_cookies[$name] : null;
    }

Usage Example

Пример #1
0
 /**
  * @inheritdoc
  */
 public function bootstrap($app)
 {
     //echo preg_replace('/ \((?!(The|UCSD)\)).*?\)/', '', 'The makanan UCSD');exit;
     if ($app instanceof \yii\web\Application) {
         $activeTheme = $this->defaultTheme;
         if ($this->useDbConfig) {
         } else {
             $cookie = new CookieCollection();
             if ($themeNameFromCookie = $cookie->get($this->themeCookieName)) {
                 $activeTheme = $themeNameFromCookie;
             }
         }
         if (!$activeTheme) {
             $activeTheme = $this->getTheme($app);
         }
     }
 }