PHPackages                             c4ys/ueditor - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. c4ys/ueditor

ActiveYii2-extension[Utility &amp; Helpers](/categories/utility)

c4ys/ueditor
============

UEditor for Yii2, 允许配置上传路径以及上传action

2.1(9y ago)020BSD-3-ClauseJavaScript

Since Jan 29Pushed 9y ago1 watchersCompare

[ Source](https://github.com/c4ys/yii2-ueditor-widget)[ Packagist](https://packagist.org/packages/c4ys/ueditor)[ RSS](/packages/c4ys-ueditor/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (5)DependenciesVersions (12)Used By (0)

百度UEditor
=========

[](#百度ueditor)

### 安装

[](#安装)

Either run

```
$ php composer.phar require c4ys/ueditor "*"

```

or add

```
"c4ys/ueditor": "*"

```

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

### 应用

[](#应用)

controller:

```
public function actions()
{
    return [
        'upload' => [
            'class' => 'c4ys\ueditor\UEditorAction',
            'config' => [
                'imageUrlPrefix' => Yii::$app->params['ueditor.upload.url'],
                'fileUrlPrefix' => Yii::$app->params['ueditor.upload.url'],
                'videoUrlPrefix' => Yii::$app->params['ueditor.upload.url'],
                'scrawlUrlPrefix' => Yii::$app->params['ueditor.upload.url'],
                'imageRoot' => Yii::$app->params['ueditor.upload.path'],
                'fileRoot' => Yii::$app->params['ueditor.upload.path'],
                'videoRoot' => Yii::$app->params['ueditor.upload.path'],
                'scrawlRoot' => Yii::$app->params['ueditor.upload.path'],
            ],
        ]
    ];
}

```

view:

```
echo \c4ys\ueditor\UEditor::widget([]);

```

或者：

```
echo $form->field($model,'colum')->widget('c4ys\ueditor\UEditor',[]);

```

### 说明

[](#说明)

`ueditor`只支持2种语言，`en-us`和`zh-cn`,默认跟随系统语言 `Yii::$app->language`,可以通过2种方式设置，1.修改系统语言，在`main.php`(高级版) 或者`web.php`(基础版)添加`'language' => 'zh-CN',`。2.实例化的时候配置语言选项，见下边配置

### 配置相关

[](#配置相关)

##### 编辑器相关配置，请在`view` 中配置，参数为`clientOptions`，比如定制菜单，编辑器大小等等，具体参数请查看[UEditor官网文档](http://fex-team.github.io/ueditor/)。

[](#编辑器相关配置请在view-中配置参数为clientoptions比如定制菜单编辑器大小等等具体参数请查看ueditor官网文档)

简单实例:

```
use \c4ys\ueditor\UEditor;
echo UEditor::widget([
    'clientOptions' => [
        //编辑区域大小
        'initialFrameHeight' => '200',
        //设置语言
        'lang' =>'en', //中文为 zh-cn
        //定制菜单
        'toolbars' => [
            [
                'fullscreen', 'source', 'undo', 'redo', '|',
                'fontsize',
                'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'removeformat',
                'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|',
                'forecolor', 'backcolor', '|',
                'lineheight', '|',
                'indent', '|',
                'simpleupload', '|',
            ],
        ]
]);
```

##### 文件上传相关配置，请在`controller`中配置，参数为`config`,例如文件上传路径等；更多参数请参照 [config.php](https://github.com/c4ys/yii2-ueditor-widget/blob/master/config.php) (跟UEditor提供的config.json一样)

[](#文件上传相关配置请在controller中配置参数为config例如文件上传路径等更多参数请参照-configphp-跟ueditor提供的configjson一样)

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity70

Established project with proven stability

 Bus Factor1

Top contributor holds 66.7% 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 ~53 days

Recently: every ~0 days

Total

11

Last Release

3634d ago

Major Versions

1.5 → 2.02016-07-11

### Community

Maintainers

![](https://www.gravatar.com/avatar/e2965f41c7bd9fc137947cec8b633039885d0ae40d4fbc0f61cd1ecb30f51b12?d=identicon)[ning](/maintainers/ning)

---

Top Contributors

[![BigKuCha](https://avatars.githubusercontent.com/u/5095944?v=4)](https://github.com/BigKuCha "BigKuCha (20 commits)")[![c4ys](https://avatars.githubusercontent.com/u/1298951?v=4)](https://github.com/c4ys "c4ys (6 commits)")[![mackong](https://avatars.githubusercontent.com/u/2212586?v=4)](https://github.com/mackong "mackong (4 commits)")

---

Tags

yii2extensionwidgetueditor

### Embed Badge

![Health badge](/badges/c4ys-ueditor/health.svg)

```
[![Health](https://phpackages.com/badges/c4ys-ueditor/health.svg)](https://phpackages.com/packages/c4ys-ueditor)
```

###  Alternatives

[kartik-v/yii2-widget-colorinput

An enhanced Yii 2 widget encapsulating the HTML 5 color input (sub repo split from yii2-widgets)

325.0M10](/packages/kartik-v-yii2-widget-colorinput)[kartik-v/yii2-sortable-input

Sortable input widget based on yii2-sortable extension.

23683.8k2](/packages/kartik-v-yii2-sortable-input)[richardfan1126/yii2-js-register

Yii2 widget to register JS into view

1358.5k7](/packages/richardfan1126-yii2-js-register)

PHPackages © 2026

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