public function init() { parent::init(); if (!$this->tree_model instanceof ActiveRecord) { throw new CException('Needs param tree_model instanceof ActiveRecord!'); } }
/** * Registers the JS and CSS Files * * @return void */ protected function registerScripts() { parent::registerCoreScripts(); $cs = Yii::app()->getClientScript(); $cs->registerCssFile($this->assets . '/ui.multiselect.css'); $cs->registerScriptFile($this->assets . '/ui.multiselect.js', CClientScript::POS_END); $parameters = CJavaScript::encode(array('sortable' => $this->sortable, 'searchable' => $this->searchable, 'height' => $this->height, 'onchange' => $this->onchange)); $cs->registerScript('EMultiSelect', '$("#' . $this->id . '").multiselect(' . $parameters . ');', CClientScript::POS_READY); }
public function init() { $class = 'application.components.activeRecordBehaviors.MetaTagBehavior'; $behaviors = $this->model->behaviors(); $classes = ArrayHelper::extract($behaviors, 'class'); if (!in_array($class, $classes)) { throw new CException("Модель должна иметь поведение: {$class}"); } parent::init(); }
public function init() { parent::init(); if (!$this->model instanceof ActiveRecord) { throw new CException(t('Needs param model instanceof ActiveRecord!')); } if (!$this->attribute) { throw new CException(t('Needs param attribute!')); } if (!is_array($this->items)) { throw new CException(t('Needs param items typeof Array!')); } }
public function init() { parent::init(); $behaviorAttached = false; foreach ($this->model->behaviors() as $id => $data) { if ($this->model->asa($id) instanceof FileManagerBehavior) { $behaviorAttached = true; break; } } if (!$behaviorAttached) { throw new CException('Требуется подключение behavior FileManagerBehavior в моделе!'); } $this->initVars(); $this->registerScripts(); }
public function init() { parent::init(); $this->registerScripts(); }