Пример #1
0
 /**
  * @inheritdoc
  */
 public function init()
 {
     $languages = Lang::find()->all();
     foreach ($languages as $language) {
         $this->languages[] = $language->getAttribute('url');
     }
     if ($this->enableLocaleUrls && $this->languages) {
         if (!$this->enablePrettyUrl) {
             throw new InvalidConfigException('Locale URL support requires enablePrettyUrl to be set to true.');
         }
     }
     $this->_defaultLanguage = Lang::getDefaultLang()->getAttribute('url');
     return parent::init();
 }