yii2-umeditor
UMeditor is a simple version ueditor., (*1)
Installation
The preferred way to install this extension is through composer., (*2)
Either run, (*3)
php composer.phar require --prefer-dist shiyang/yii2-umeditor "*"
or add, (*4)
"shiyang/yii2-umeditor": "*"
to the require section of your composer.json
file., (*5)
Usage
Once the extension is installed, simply use it in your code by :, (*6)
controller:, (*7)
public function actions()
{
return [
'upload' => [
'class' => 'shiyang\umeditor\UMeditorAction',
]
];
}
view:, (*8)
= $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) ?>
= Html::submitButton('Create', ['class' => 'btn btn-primary']) ?>
Please, check the Umeditor plugin site or config documentation for further information about its configuration options., (*9)
Demo
See umeditor, (*10)