yii2-extensions/summernote

Summernote - Super Simple WYSIWYG editor.

Installs: 211

Dependents: 1

Suggesters: 0

Security: 0

Stars: 1

Watchers: 1

Forks: 0

Open Issues: 0

Language:JavaScript

dev-main / 1.0.x-dev 2023-12-15 21:31 UTC

This package is auto-updated.

Last update: 2024-04-15 22:22:57 UTC


README

68747470733a2f2f7777772e7969696672616d65776f726b2e636f6d2f696d6167652f7969695f6c6f676f5f6c696768742e737667

Summernote - Super Simple WYSIWYG editor.


php-version PHPUnit PHPUnit Codecov Infection

summernote.png

Installation

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.

Usage

Name

use Yii2\Extensions\Summernote\Summernote;

echo Summernote::widget(
    [
        'name' => 'content',
        'value' => $value,
        'config' => [
            'focus' => true,
            'height' => 200,
            'maxHeight' => null,
            'minHeight' => null,
            'placeholder' => 'Write here...',
        ],
    ]
);

Active Field

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...',
            ],
        ]
    );

Properties of the widget

Property Type Description Default
config array The configuration of the widget. []

When YII_ENV is set to dev or test, the widget will load the non-minified version of the JavaScript files, otherwise it will load the minified version.

Quality code

static-analysis phpstan-level style-ci

Support versions Yii2

Yii20 Yii22

Testing

Check the documentation testing to learn about testing.

Our social networks

Twitter

License

The MIT License. Please see License File for more information.