The preferred way to install this extension is through composer.
Either run
composer require --dev --prefer-dist yii2-extensions/summernote
or add
"yii2-extensions/summernote": "dev-main"
to the require-dev section of your composer.json
file.
use Yii2\Extensions\Summernote\Summernote;
echo Summernote::widget(
[
'name' => 'content',
'value' => $value,
'config' => [
'focus' => true,
'height' => 200,
'maxHeight' => null,
'minHeight' => null,
'placeholder' => 'Write here...',
],
]
);
use Yii2\Extensions\Summernote\Summernote;
echo $form
->field($model, 'content')
->widget(
Summernote::class,
[
'config' => [
'focus' => true,
'height' => 200,
'maxHeight' => null,
'minHeight' => null,
'placeholder' => 'Write here...',
],
]
);
Property | Type | Description | Default |
---|---|---|---|
config |
array |
The configuration of the widget. | [] |
When YII_ENV is set to
dev
ortest
, the widget will load the non-minified version of the JavaScript files, otherwise it will load the minified version.
Check the documentation testing to learn about testing.
The MIT License. Please see License File for more information.