PHPackages                             myzero1/yii2-ckeditor - 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. [Templating &amp; Views](/categories/templating)
4. /
5. myzero1/yii2-ckeditor

ActiveYii2-extension[Templating &amp; Views](/categories/templating)

myzero1/yii2-ckeditor
=====================

CKEditor widget for Yii 2

4.11.2(7y ago)0151MITPHP

Since Jan 4Pushed 7y agoCompare

[ Source](https://github.com/myzero1/yii2-ckeditor)[ Packagist](https://packagist.org/packages/myzero1/yii2-ckeditor)[ RSS](/packages/myzero1-yii2-ckeditor/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (5)Dependencies (2)Versions (7)Used By (0)

CKEditor widget for Yii 2
=========================

[](#ckeditor-widget-for-yii-2)

This extension renders a [CKEditor](http://ckeditor.com/) widget for [Yii framework 2.0](http://www.yiiframework.com).

[![License](https://camo.githubusercontent.com/9e69f2ae30d7d365959cdef6edae4c711231d9039374ea8312cc85faa4410f1e/68747470733a2f2f706f7365722e707567782e6f72672f6d797a65726f312f796969322d636b656469746f722f6c6963656e7365)](https://packagist.org/packages/myzero1/yii2-ckeditor)

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

[](#installation)

Install extension through [composer](http://getcomposer.org/):

Either run

```
php composer.phar require "myzero1/yii2-ckeditor" "*"

```

or add

```
"myzero1/yii2-ckeditor" : "*"
```

to the require section of your application's `composer.json` file.

Config the action for upload
----------------------------

[](#config-the-action-for-upload)

Add the section of your application's `main.json` file, as flowing:

```

return [
    ......
    'controllerNamespace' => 'backend\controllers',
    'controllerMap' => [
        'ckeditor' => [
            'class' => 'myzero1\ckeditor\CKditorController',
            'config' => [
                'imageFieldName' => 'upload',
                'imageMaxSize' => 1024*1024*2, // 2M = 1024*1024*2
                'imageAllowFiles' => ['.jpg', '.jpeg', '.png', '.gif'],
                'imagePathFormat' => '/upload/image/{yyyy}{mm}{dd}/{time}{rand:8}',
            ],
        ]
    ],
    'bootstrap' => ['log'],
    ......

```

Usage
-----

[](#usage)

The following code in a view file would render a CKEditor widget:

```
