UMeditor is a simple version ueditor.
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist shiyang/yii2-umeditor "*"
or add
"shiyang/yii2-umeditor": "*"
to the require section of your composer.json
file.
Once the extension is installed, simply use it in your code by :
controller:
public function actions()
{
return [
'upload' => [
'class' => 'shiyang\umeditor\UMeditorAction',
]
];
}
view:
<?php $form = ActiveForm::begin(); ?>
<?= $form->field($model, 'content')->widget('shiyang\umeditor\UMeditor', [
'clientOptions' => [
'initialFrameHeight' => 100,
'toolbar' => [
'source | undo redo | bold |',
'link unlink | emotion image video |',
'justifyleft justifycenter justifyright justifyjustify |',
'insertorderedlist insertunorderedlist |' ,
'horizontal preview fullscreen',
],
]
])->label(false) ?>
<div class="form-group">
<?= Html::submitButton('Create', ['class' => 'btn btn-primary']) ?>
</div>
<?php ActiveForm::end(); ?>
Please, check the Umeditor plugin site or config documentation for further information about its configuration options.
See umeditor