public function init() { parent::init(); //attach events from $this->eventMap foreach ($this->handlers() as $event=>$handler) $this->addHandler($event, $handler); //dataTypes register ModelFactory::registerDataTypes($this->dataTypes()); //register widets Y::resources()->registerWidgets($this->widgets()); //set assets path if (is_dir($path = Yii::getPathOfAlias($this->getId().'.assets'))) { $this->scriptPath = Yii::app()->getAssetManager()->publish($path); } }