moonlandsoft/yii2-tinymce
The TinyMCE Extension for yii framework, (*1)
, (*2)
Installation
The preferred way to install this extension is through composer., (*3)
Either run, (*4)
php composer.phar require --prefer-dist moonlandsoft/yii2-tinymce "*"
or add, (*5)
"moonlandsoft/yii2-tinymce": "*"
to the require section of your composer.json
file., (*6)
Usage
Once the extension is installed, simply use it in your code by :, (*7)
use moonland\tinymce\TinyMCE;
echo TinyMCE::widget(['name' => 'text-content']);
$form->field($model, 'attribute')->widget(TinyMCE::className());
//toggle to tinyMCE or to textarea
echo TinyMCE::widget(['name' => 'text-content', 'toggle' => ['active' => true]]);
$form->field($model, 'attribute')->widget(TinyMCE::className(), [
'toggle' => [
'active' => true,
]
]);