PHPackages                             davidxu/yii2-wang-editor - 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. [Framework](/categories/framework)
4. /
5. davidxu/yii2-wang-editor

ActiveYii2-extension[Framework](/categories/framework)

davidxu/yii2-wang-editor
========================

a wangEditor for Yii2 framework

5.0.0(1y ago)023MITPHPPHP &gt;=8.0

Since Sep 17Pushed 1y ago1 watchersCompare

[ Source](https://github.com/davidxuuts/yii2-wang-editor)[ Packagist](https://packagist.org/packages/davidxu/yii2-wang-editor)[ RSS](/packages/davidxu-yii2-wang-editor/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (8)Used By (0)

A WangEditor 5 for Yii2 framework
=================================

[](#a-wangeditor-5-for-yii2-framework)

A WYSIWYG Rich text [wangEditor 5](https://www.wangeditor.com/) extension for [Yii2](https://www.yiiframework.com/)

一个所见即所得富文本编辑器[wangEditor 5](https://www.wangeditor.com/)的[Yii2](https://www.yiiframework.com/)扩展。

Functions 功能
------------

[](#functions-功能)

It supports multiple wangEditor5 instances on one page.

本扩展支持同一个页面多个wangEditor实例。

It also supports second upload function by used Qiniu [QETag](https://github.com/qiniu/qetag).

本扩展通过使用七牛[QETag](https://github.com/qiniu/qetag)支持秒传功能。

Chunk upload is also enabled. If custom `chunkSize` more than system size (`get_cfg_var('upload_max_filesize')`), system upload max filesize will be used

本扩展已设置为使用分片上传。如果设置的`chunkSize`大于系统设置值 (`get_cfg_var('upload_max_filesize')`), 将会使用系统值。

You can upload files to local server or [Qiniu Kodo](https://developer.qiniu.com/kodo) currently.

可以上传文件到本地服务器或者直接上传文件到七牛对象存储 Kodo。

For more Qiniu Kodo policy please refer to Qiniu website.

要了解七牛对象存储Kodo的更多信息和相关安全策略，请自行参考七牛官方网站。

We use custom function for video/image upload and insert.

本扩展采用自定义功能上传和插入视频/图片。

Installation 安装
---------------

[](#installation-安装)

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

安装本扩展最便捷的方法是通过Composer安装。

Either run 执行

```
php composer.phar require --prefer-dist davidxu/yii2-wang-editor

```

or add 或增加

```
"davidxu/yii2-wang-editor": "*"

```

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

到`composer.json`相关区域。

Usage 使用
--------

[](#usage-使用)

If you want to store files information in DB (MySQL/MariaDB), please excute migration file by

如果你想保存文件信息到数据库(MySQL/MariaDB)，请首先执行以下迁移文件

```
yii migrate/up @davidxu/base/migrations

```

and then simply use it in your code by:

然后先这样使用:

### for Local upload 上传到本地服务器

[](#for-local-upload-上传到本地服务器)

---

##### In View 视图端

[](#in-view-视图端)

```
