Пример #1
0
 public function init()
 {
     $this->controller = $this->getView()->context;
     foreach ($this->controller->getBehaviors() as $behavior) {
         if ($behavior instanceof Behavior) {
             $this->wizard = $behavior;
         }
     }
     if (!$this->wizard instanceof Behavior) {
         throw new InvalidConfigException(\Yii::t('wizard', 'Behavior ' . __NAMESPACE__ . '\\Behavior not found at Controller'));
     }
     $defaultConfig = [];
     $defaultConfig['class'] = '\\yii\\bootstrap\\Nav';
     $defaultConfig['items'] = $this->generateMenuItems();
     $this->widget = \Yii::createObject(ArrayHelper::merge($defaultConfig, $this->menuConfig));
     parent::init();
 }