示例#1
0
 /**
  * [[@doctodo method_description:onAfterInit]].
  *
  * @param [[@doctodo param_type:event]] $event [[@doctodo param_description:event]]
  *
  * @throws Exception [[@doctodo exception_description:Exception]]
  * @return [[@doctodo return_type:onAfterInit]] [[@doctodo return_description:onAfterInit]]
  *
  */
 public function onAfterInit($event)
 {
     if (isset(Yii::$app->collectors['widgets']) and !Yii::$app->collectors['widgets']->registerMultiple($this, $this->widgets())) {
         throw new Exception('Could not register widgets for ' . $this->systemId . '!');
     }
     return parent::onAfterInit($event);
 }
示例#2
0
 /**
  * @inheritdoc
  */
 public function onAfterInit($event)
 {
     if (!isset(Yii::$app->collectors['taxonomies']) || !Yii::$app->collectors['taxonomies']->registerMultiple($this, $this->taxonomies())) {
         throw new Exception('Could not register taxonmies for ' . $this->systemId . '!');
     }
     if (!isset(Yii::$app->collectors['widgets']) || !Yii::$app->collectors['widgets']->registerMultiple($this, $this->widgets())) {
         throw new Exception('Could not register widgets for ' . $this->systemId . '!');
     }
     // if (!isset(Yii::$app->collectors['roles']) || !Yii::$app->collectors['roles']->registerMultiple($this, $this->roles())) { throw new Exception('Could not register roles for '. $this->systemId .'!'); }
     // if (!isset(Yii::$app->collectors['tools']) || !Yii::$app->collectors['tools']->registerMultiple($this, $this->tools())) { throw new Exception('Could not register tools for '. $this->systemId .'!'); }
     // if (!isset(Yii::$app->collectors['reports']) || !Yii::$app->collectors['reports']->registerMultiple($this, $this->reports())) { throw new Exception('Could not register reports for '. $this->systemId .'!'); }
     return parent::onAfterInit($event);
 }