PHPackages                             kartik-v/yii2-editors - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [File &amp; Storage](/categories/file-storage)
4. /
5. kartik-v/yii2-editors

ActiveYii2-extension[File &amp; Storage](/categories/file-storage)

kartik-v/yii2-editors
=====================

Editor widgets Yii2 framework. Summernote WYSIWYG editor, Codemirror code editor and PlainText editor for Bootstrap 3.x, 4.x and 5.x.

v1.0.1(4y ago)23300.9k↓17%7[3 issues](https://github.com/kartik-v/yii2-editors/issues)1BSD-3-ClausePHP

Since May 29Pushed 2y ago2 watchersCompare

[ Source](https://github.com/kartik-v/yii2-editors)[ Packagist](https://packagist.org/packages/kartik-v/yii2-editors)[ Docs](https://github.com/kartik-v/yii2-editors)[ RSS](/packages/kartik-v-yii2-editors/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (1)

 [ ![Krajee Logo](https://camo.githubusercontent.com/4addfbb3869c3fc7d79befea4f06d9cf3655a686fb503df0da1d725859cfdef9/687474703a2f2f6b617274696b2d762e6769746875622e696f2f626f6f7473747261702d66696c65696e7075742d73616d706c65732f73616d706c65732f6b72616a65652d6c6f676f2d622e706e67) ](http://demos.krajee.com "Krajee Demos")
 yii2-editors ---

 [ ![Donate](https://camo.githubusercontent.com/4af77d425ca202e55ab3d711b438e238ded194735bc345a019ac060e03e26227/687474703a2f2f6b617274696b2d762e6769746875622e696f2f626f6f7473747261702d66696c65696e7075742d73616d706c65732f73616d706c65732f646f6e6174652e706e67) ](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=DTP3NZQ6G2AYU "Donate via Paypal")
================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================

[](#------------------------yii2-editors--------------------)

[![Stable Version](https://camo.githubusercontent.com/8a598f1a45f55b5077d7774b35e5e16ba23b2308cab0a3374b3b382ef6c1e3f8/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d656469746f72732f762f737461626c65)](https://packagist.org/packages/kartik-v/yii2-editors)[![Unstable Version](https://camo.githubusercontent.com/f5f856f75a9b3b68586d4b2a447022088a93ecc25cc4d7c5e976d0a131c42ce2/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d656469746f72732f762f756e737461626c65)](https://packagist.org/packages/kartik-v/yii2-editors)[![License](https://camo.githubusercontent.com/e63c57da305bb1ee2d8b35082f3fd6fac8216daeb71e5a295143ff82f6d3aa34/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d656469746f72732f6c6963656e7365)](https://packagist.org/packages/kartik-v/yii2-editors)[![Total Downloads](https://camo.githubusercontent.com/2fa3bd67a6f2e82238ca8987416d07cdf903fe95ae023753db401c456b41971e/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d656469746f72732f646f776e6c6f616473)](https://packagist.org/packages/kartik-v/yii2-editors)[![Monthly Downloads](https://camo.githubusercontent.com/8a974d9defd79cfd2b41f0e9f950c3ead5838ec2a1fc351d61344fee259a89d8/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d656469746f72732f642f6d6f6e74686c79)](https://packagist.org/packages/kartik-v/yii2-editors)[![Daily Downloads](https://camo.githubusercontent.com/0787b9538c870633f7ec8a73e002d4fc0e3fca7c83ecec7ba90bc45cb48b357b/68747470733a2f2f706f7365722e707567782e6f72672f6b617274696b2d762f796969322d656469746f72732f642f6461696c79)](https://packagist.org/packages/kartik-v/yii2-editors)

Editor widgets for Yii2 framework - Summernote and Codemirror.

Summernote is a WYSIWYG rich text HTML input widget which uses the [Summernote](https://summernote.org/)WYSWIYG plugin and is styled for both Bootstrap 3.x &amp; 4.x. Includes additional enhancements by Krajee for Bootstrap 3.x and 4.x support, and ability to format code, and render preset configurable toolbars.

Codemirror is a plain text code editor that allows syntax formatting of various code.

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/). Check the [composer.json](https://github.com/kartik-v/yii2-editors/blob/master/composer.json) for this extension's requirements and dependencies. Read this [web tip /wiki](http://webtips.krajee.com/setting-composer-minimum-stability-application/) on setting the `minimum-stability` settings for your application's composer.json.

To install, either run

```
$ php composer.phar require kartik-v/yii2-editors "@dev"

```

or add

```
"kartik-v/yii2-editors": "@dev"

```

to the `require` section of your `composer.json` file.

Refer the [CHANGE LOG](https://github.com/kartik-v/yii2-editors/blob/master/CHANGE.md) for details of release wise changes.

Demo
----

[](#demo)

You can see detailed [documentation and examples](http://demos.krajee.com/editors) on usage of the extension.

Prerequisites
-------------

[](#prerequisites)

The Codemirror widget requires Font Awesome Icon assets rendered on the page for rendering the toolbar. You can render the font awesome icon assets on your page using one of the options below:

- **Option 1**: Font CSS version of Font Awesome:

```

```

- **Option 2**: SVG / JS version of Font Awesome (e.g. from kartik-v/yii2-icons library):

```
// on your view layout file
use kartik\icons\FontAwesomeAsset;
FontAwesomeAsset::register($this);
```

Usage
-----

[](#usage)

### Summernote WYSIWYG Editor

[](#summernote-wysiwyg-editor)

[![Summernote Editor Screenshot](https://user-images.githubusercontent.com/3592619/64076550-e568bd80-cce3-11e9-9c62-fe4cdf20be90.png)](https://user-images.githubusercontent.com/3592619/64076550-e568bd80-cce3-11e9-9c62-fe4cdf20be90.png)

```
use kartik\editors\Summernote;

// Usage with ActiveForm and model and default settings
echo $form->field($model, 'content')->widget(Summernote::class, [
    'options' => ['placeholder' => 'Edit your blog content here...']
]);

// With model & without ActiveForm and default settings
echo Summernote::widget([
    'model' => $model,
    'attribute' => 'html_content',
]);

// Without model and setting advanced custom widget configuration options
echo Summernote::widget([
    'name' => 'blog_post',
    'value' => '',
    'useKrajeeStyle' => true,
    'useKrajeePresets' => true,
    'enableFullScreen' => true,
    'enableCodeView' => false,
    'enableHelp' => false,
    'enableHintEmojis' => true,
    'hintMentions' => ['jayden', 'sam', 'alvin', 'david']
]);
```

### Codemirror Code Editor

[](#codemirror-code-editor)

[![Codemirror Editor Screenshot](https://user-images.githubusercontent.com/3592619/64076610-9c653900-cce4-11e9-8281-8cb7cf94f1a5.png)](https://user-images.githubusercontent.com/3592619/64076610-9c653900-cce4-11e9-8281-8cb7cf94f1a5.png)

```
use kartik\editors\Codemirror;

// Usage with ActiveForm and model and default settings
echo $form->field($model, 'program_code')->widget(Codemirror::class, [
    'preset' => Codemirror::PRESET_PHP,
    'options' => ['placeholder' => 'Edit your code here...']
]);

// With model & without ActiveForm and default settings
echo Codemirror::widget([
    'model' => $model,
    'attribute' => 'json_code',
    'preset' => Codemirror::PRESET_JSON,
]);

// Without model and setting advanced custom widget configuration options
echo Codemirror::widget([
    'name' => 'js_code',
    'value' => '',
    'preset' => Codemirror::PRESET_JS,
    'useKrajeePresets' => true,
    'libraries' => [
        'addon/display/placeholder.js',
        'addon/fold/xml-fold.js',
        'addon/edit/matchbrackets.js',
        'addon/edit/matchtags.js',
        'addon/selection/active-line.js',
        'addon/selection/selection-pointer.js',
    ],
    'pluginOptions' => [
        'modes' => ['xml', 'javascript', 'css'],
    ]
]);
```

License
-------

[](#license)

**yii2-editors** is released under the BSD-3-Clause License. See the bundled `LICENSE.md` for details.

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance17

Infrequent updates — may be unmaintained

Popularity45

Moderate usage in the ecosystem

Community15

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 93.8% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~96 days

Total

2

Last Release

1719d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/3592619?v=4)[Kartik Visweswaran](/maintainers/kartik-v)[@kartik-v](https://github.com/kartik-v)

---

Top Contributors

[![kartik-v](https://avatars.githubusercontent.com/u/3592619?v=4)](https://github.com/kartik-v "kartik-v (15 commits)")[![pappfer](https://avatars.githubusercontent.com/u/738623?v=4)](https://github.com/pappfer "pappfer (1 commits)")

---

Tags

codehtmlfileyii2extensionwidgeteditorbootstrapwysiwyginputcodemirrorsummernoterich

### Embed Badge

![Health badge](/badges/kartik-v-yii2-editors/health.svg)

```
[![Health](https://phpackages.com/badges/kartik-v-yii2-editors/health.svg)](https://phpackages.com/packages/kartik-v-yii2-editors)
```

###  Alternatives

[kartik-v/yii2-widget-fileinput

An enhanced FileInput widget for Bootstrap 3.x, 4.x &amp; 5.x with file preview, multiple selection, and more features (sub repo split from yii2-widgets)

2286.8M95](/packages/kartik-v-yii2-widget-fileinput)[kartik-v/yii2-widget-rating

A Yii2 widget for the simple yet powerful bootstrap-star-rating plugin with fractional rating support (sub repo split from yii2-widgets)

444.1M8](/packages/kartik-v-yii2-widget-rating)[kartik-v/yii2-widget-switchinput

A Yii2 wrapper widget for the Bootstrap Switch plugin to use checkboxes &amp; radios as toggle switchinputes (sub repo split from yii2-widgets)

384.4M13](/packages/kartik-v-yii2-widget-switchinput)[kartik-v/yii2-markdown

Advanced Markdown editing and conversion utilities for Yii Framework 2.0

88265.8k6](/packages/kartik-v-yii2-markdown)[kartik-v/yii2-widget-touchspin

A Yii2 wrapper widget for the Bootstrap Switch plugin to use checkboxes &amp; radios as toggle touchspines (sub repo split from yii2-widgets)

184.1M6](/packages/kartik-v-yii2-widget-touchspin)[bizley/contenttools

ContentTools editor implementation for Yii 2.

8016.7k](/packages/bizley-contenttools)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
