|
| 1 | +<?php |
| 2 | + |
| 3 | +use mihaildev\ckeditor\CKEditor; |
| 4 | +use \yii\web\View; |
| 5 | + |
| 6 | +/** |
| 7 | + * @var $form \yii\widgets\ActiveForm |
| 8 | + * @var $block \nullref\cms\blocks\html\Block |
| 9 | + * @var $this \yii\web\View |
| 10 | + */ |
| 11 | +list(, $footnotesUrl) = Yii::$app->assetManager->publish('@nullref/cms/assets/ckeditor-plugins/codemirror'); |
| 12 | +$this->registerJs("CKEDITOR.plugins.addExternal( 'codemirror', '" . $footnotesUrl . "/','plugin.js');", View::POS_END); |
| 13 | + |
| 14 | +echo $form->field($block, 'content')->widget(CKEditor::className(), [ |
| 15 | + 'id' => 'editor', |
| 16 | + 'editorOptions' => [ |
| 17 | + 'preset' => 'full', |
| 18 | + 'inline' => false, |
| 19 | + 'extraPlugins' => 'codemirror', |
| 20 | + 'codemirror' => [ |
| 21 | + 'autoCloseBrackets' => true, |
| 22 | + 'autoCloseTags' => true, |
| 23 | + 'autoFormatOnStart' => true, |
| 24 | + 'autoFormatOnUncomment' => true, |
| 25 | + 'continueComments' => true, |
| 26 | + 'enableCodeFolding' => true, |
| 27 | + 'enableCodeFormatting' => true, |
| 28 | + 'enableSearchTools' => true, |
| 29 | + 'highlightMatches' => true, |
| 30 | + 'indentWithTabs' => false, |
| 31 | + 'lineNumbers' => true, |
| 32 | + 'lineWrapping' => true, |
| 33 | + 'mode' => 'htmlmixed', |
| 34 | + 'matchBrackets' => true, |
| 35 | + 'matchTags' => true, |
| 36 | + 'showAutoCompleteButton' => true, |
| 37 | + 'showCommentButton' => true, |
| 38 | + 'showFormatButton' => true, |
| 39 | + 'showSearchButton' => true, |
| 40 | + 'showTrailingSpace' => true, |
| 41 | + 'showUncommentButton' => true, |
| 42 | + 'styleActiveLine' => true, |
| 43 | + 'theme' => 'default', |
| 44 | + 'useBeautify' => true, |
| 45 | + ], |
| 46 | + ], |
| 47 | +]); |
| 48 | +echo $form->field($block, 'tag')->textInput(); |
| 49 | +echo $form->field($block, 'tagClass')->textInput(); |
| 50 | +echo $form->field($block, 'carouselName')->textInput(); |
0 commit comments