An open API service indexing awesome lists of open source software.

https://github.com/yii2-extensions/summernote

Super simple WYSIWYG editor on Bootstrap.
https://github.com/yii2-extensions/summernote

summernote widget yii2 yii2-extensions

Last synced: about 1 month ago
JSON representation

Super simple WYSIWYG editor on Bootstrap.

Awesome Lists containing this project

README

        





Summernote - Super Simple WYSIWYG editor.





php-version


PHPUnit


PHPUnit


Codecov


Infection





## Installation

The preferred way to install this extension is through [composer](https://getcomposer.org/download/).

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

```php
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

```php
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](https://github.com/yii2-extensions/gii/actions/workflows/static.yml/badge.svg)](https://github.com/yii2-extensions/summernote/actions/workflows/static.yml)
[![phpstan-level](https://img.shields.io/badge/PHPStan%20level-7-blue)](https://github.com/yii2-extensions/summernote/actions/workflows/static.yml)
[![style-ci](https://github.styleci.io/repos/711200053/shield?branch=main)](https://github.styleci.io/repos/711200053?branch=main)

## Support versions Yii2

[![Yii20](https://img.shields.io/badge/Yii2%20version-2.0-blue)](https://github.com/yiisoft/yii2/tree/2.0.49.3)
[![Yii22](https://img.shields.io/badge/Yii2%20version-2.2-blue)](https://github.com/yiisoft/yii2/tree/2.2)

## Testing

[Check the documentation testing](/docs/testing.md) to learn about testing.

## Our social networks

[![Twitter](https://img.shields.io/badge/twitter-follow-1DA1F2?logo=twitter&logoColor=1DA1F2&labelColor=555555?style=flat)](https://twitter.com/Terabytesoftw)

## License

The MIT License. Please see [License File](LICENSE.md) for more information.