コード例 #1
0
ファイル: Column.php プロジェクト: kotchuprik/yii2-x-editable
 /**
  * @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 . ');');
 }
コード例 #2
0
 /**
  * @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);
 }