/** * @inheritdoc */ public function registerAssets() { $config = new XEditableConfig(); 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(); XEditableAsset::register($this->view); $this->editable = Json::encode($this->editable); $this->view->registerJs('$(".editable[data-name=' . $this->attribute . ']").editable(' . $this->editable . ');'); }
/** * @see Xeditable * @see Register assets from this extension and yours types */ public function registerAssets() { $config = new XEditableConfig(); 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(); if ($this->type == 'select2') { Select2Asset::register($this->view); } if ($this->type == 'datetime') { //DateTimePickerAsset::register($this->view); } if ($this->type == 'date') { //DatePickerAsset::register($this->view); } if ($this->type == 'typeaheadjs') { TypeaheadAsset::register($this->view); } if ($this->type == 'combodate') { //ComboDateAsset::register($this->view); } if ($this->type == 'wysihtml5') { //WysiHtml5Asset::register($this->view); } $this->view = \Yii::$app->getView(); XEditableAsset::register($this->view); }