/** * Registers CKEditor plugin */ protected function registerPlugin() { $view = $this->getView(); $this->ckeditor = new \skeeks\cms\widgets\formInputs\ckeditor\Ckeditor(ArrayHelper::merge(['model' => $this->model, 'attribute' => $this->attribute, 'relatedModel' => $this->model], $this->ckeditorOptions)); $this->codemirror = new CodemirrorWidget(ArrayHelper::merge(['model' => $this->model, 'attribute' => $this->attribute, 'preset' => 'htmlmixed', 'assets' => [\skeeks\widget\codemirror\CodemirrorAsset::THEME_NIGHT], 'clientOptions' => ['theme' => 'night']], $this->codemirrorOptions)); $this->ckeditor->registerAssets(); $this->codemirror->registerAssets(); $this->clientOptions['ckeditor'] = $this->ckeditor->clientOptions; $this->clientOptions['codemirror'] = $this->codemirror->clientOptions; ComboTextInputWidgetAsset::register($this->view); }
* @link http://skeeks.com/ * @copyright 2010 SkeekS (—кик—) * @date 07.11.2015 */ /* @var $this yii\web\View */ /* @var $rootViewFile string */ /* @var $model \skeeks\cms\models\forms\ViewFileEditModel */ $this->registerCss(<<<CSS .CodeMirror { height: auto; } CSS ); ?> <?php $form = \skeeks\cms\modules\admin\widgets\form\ActiveFormStyled::begin(['useAjaxSubmit' => true, 'usePjax' => false, 'enableAjaxValidation' => false]); ?> <?php echo $form->field($model, 'source')->label($model->rootViewFile)->widget(\skeeks\widget\codemirror\CodemirrorWidget::className(), ['preset' => 'htmlmixed', 'assets' => [\skeeks\widget\codemirror\CodemirrorAsset::THEME_NIGHT], 'clientOptions' => ['theme' => 'night'], 'options' => ['rows' => 40]]); ?> <?php echo $form->buttonsStandart($model); ?> <?php \skeeks\cms\modules\admin\widgets\form\ActiveFormStyled::end();