jocoh / yii2-tinymce-widget
TinyMCE Widget for Yii2
Package info
github.com/jocoh/yii2-tinymce-widget
Type:yii2-extension
pkg:composer/jocoh/yii2-tinymce-widget
v1.0.2
2016-12-11 11:06 UTC
Requires
- tinymce/tinymce: >=4
- yiisoft/yii2: ~2.0.0
This package is not auto-updated.
Last update: 2026-03-15 04:12:48 UTC
README
TinyMCE Widget for Yii2
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require jocoh/yii2-tinymce-widget "*"
or add
"jocoh/yii2-tinymce-widget": "*"
to the require section of your composer.json file.
Usage
Once the extension is installed, simply use it in your code by :
Possible TinyMCE options:
use jocoh\tinymce\TinyMce;
echo TinyMce::widget( [
'name' => 'content',
'options' => ['rows' => 6],
'clientOptions' => [
'plugins' => [
"advlist autolink lists link charmap print preview anchor",
"searchreplace visualblocks code fullscreen",
"insertdatetime media table contextmenu paste"
],
'toolbar' => "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image"
],
]);
?>
ActiveForm
use jocoh\tinymce\TinyMce;
echo $form->field($model, 'content')->widget(TinyMce::className(), [
'options' => ['rows' => 6],
'clientOptions' => [
'plugins' => [
"advlist autolink lists link charmap print preview anchor",
"searchreplace visualblocks code fullscreen",
"insertdatetime media table contextmenu paste"
],
'toolbar' => "undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image"
],
]);