WYSIWYG HTML editor widget for Yii2 based on CKEditor.
The preferred way to install this extension is through composer.
Add
"himiklab/yii2-ckeditor-widget" : "*"
to the require section of your application's composer.json
file.
If you use "minimum-stability": "stable"
add before this line:
"ckeditor/ckeditor": "dev-full/stable"
Using as field in ActiveForm:
use himiklab\ckeditor\CKEditor;
<?= $form->field($model, 'text')->widget(CKEditor::className(), [
'editorOptions' => ['height' => '500px']
]) ?>
Using as inline field:
use himiklab\ckeditor\CKEditor;
<?= CKEditor::widget([
'name' => 'comment',
'value' => 'Please write your comment',
'editorOptions' => ['height' => '500px']
]) ?>
Comments