SCEditor, a lightweight WYSIWYG BBCode & HTML editor extension for Yii 2.0 Framework
The preferred way to install this extension is through composer.
To install, either run
$ php composer.phar require rikcage/yii2-sceditor "*"
or add
"rikcage/yii2-sceditor": "*"
to the require
section of your composer.json
file.
Once the extension is installed, simply use it in your code by :
use rikcage\sceditor\SCEditor;
<?= $form->field($model, 'text')->widget(SCEditor::className(), [
'options' => ['rows' => 6],
'clientOptions' => [
'format' => 'bbcode',
]
]) ?>
or
use rikcage\sceditor\SCEditor;
<?= $form->field($model, 'text')->widget(SCEditor::className(), [
'options' => ['rows' => 6],
'clientOptions' => [
'format' => 'xhtml',
]
]) ?>
Please, check the SCEditor plugin site documentation for further information about its configuration options.