/** * @inheritdoc */ public function registerAssets() { $config = new Config(); if (isset($this->pluginOptions['mode']) && is_array($this->pluginOptions)) { $config->mode = $this->pluginOptions['mode']; } if (isset($this->pluginOptions['form']) && is_array($this->pluginOptions)) { $config->form = $this->pluginOptions['form']; } $config->registerDefaultAssets(); $this->view = \Yii::$app->getView(); Asset::register($this->view); $this->editable = Json::encode($this->editable); $this->view->registerJs('$(".editable").editable(' . $this->editable . ');'); }
/** * @see Xeditable * @see Register assets from this extension and yours types */ public function registerAssets() { $config = new Config(); if (isset($this->pluginOptions['mode']) && is_array($this->pluginOptions)) { $config->mode = $this->pluginOptions['mode']; } if (isset($this->pluginOptions['form']) && is_array($this->pluginOptions)) { $config->form = $this->pluginOptions['form']; } $config->view = \Yii::$app->getView(); $config->registerDefaultAssets(); AssetRegistrator::register($this->type, $this->view); $this->view = \Yii::$app->getView(); \kotchuprik\xeditable\assets\Asset::register($this->view); }