Either run
php composer.phar require --prefer-dist brussens/yii2-trumbowyg "*"
or add
"brussens/yii2-trumbowyg": "*"
to the require section of your composer.json
file.
use brussens\yii2\extensions\trumbowyg\TrumbowygWidget;
echo $form->field($form, 'content')->widget(TrumbowygWidget::className());
use brussens\yii2\extensions\trumbowyg\TrumbowygWidget;
echo $form->field($form, 'content')->widget(TrumbowygWidget::className(), [
'clientOptions' => [
'btns' => [
['viewHTML'],
['undo', 'redo'],
['table'],
['formatting'],
['strong', 'em', 'del'],
['link'],
['justifyLeft', 'justifyCenter', 'justifyRight', 'justifyFull'],
['unorderedList', 'orderedList'],
['removeformat'],
['fullscreen'],
['upload'],
]
],
'plugins' => [
TrumbowygWidget::PLUGIN_UPLOAD,
TrumbowygWidget::PLUGIN_TABLE,
TrumbowygWidget::PLUGIN_HISTORY
]
]);
Comments