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

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

hahadu/think-editor
===================

thinkphp 集成富文本编辑器服务端处理模块

v0.1.2(5y ago)18Apache-2.0PHPPHP &gt;=5.6

Since Mar 29Pushed 4y ago1 watchersCompare

[ Source](https://github.com/hahadu/think-editor)[ Packagist](https://packagist.org/packages/hahadu/think-editor)[ RSS](/packages/hahadu-think-editor/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (3)Versions (4)Used By (0)

think-editor
============

[](#think-editor)

thinkphp 集成富文本编辑器服务端处理模块

#### 安装

[](#安装)

composer require hahadu/think-editor

wangEditor编辑器上传服务端配置:
---------------------

[](#wangeditor编辑器上传服务端配置)

### 引入文件:

[](#引入文件)

```
use Hahadu\ThinkEditor\Client\WangEditor;
$wE = new WangEditor();
```

### 上传文件：

[](#上传文件)

在wangEditor配置

```
const E = window.wangEditor
const editor = new E('#div1')

// 配置 server 接口地址
editor.config.uploadImgServer = '';
//设置上传表单名称 以files为例
editor.config.uploadFileName = "files"

editor.create()
```

文件上传处理方法,返回json

```
//服务端配置
$config = [
        'disk' => 'public', //filesystem 中的disk配置 默认public
     //   'putFilePath' => 'files', //disk/url目录的下级目录，不设置则根据文件类型自动选择
        'upValidate'=> [ //上传文件验证规则
            'fileSize:10240000', //默认上传限制10M php.ini调整上传大小
            //'fileExt:jpg,png,gif,mp4', //允许上传的文件格式
        ],

        'water' => [ //水印设置
            'add_water_type' => 1, //添加水印 0不添加水印，1添加文字水印，2添加图片水印
        ],
        'base64' => [ //base64文件上传设置
            'extName' => 'jpg', //缓存名字后缀
        ],

];

$fileFiled = 'files'; // 文件上传表单名称
return $wE->uploader($fileFiled);
```

### 转换base64方法上传文件的base64文件为本地文件

[](#转换base64方法上传文件的base64文件为本地文件)

表单提交地址（非文件上传的server地址）主处理方法，返回转换后的文本内容

```
//假设提交文本内容的表单名称为content
$content = request()->post('content');

echo $wE->base64Img($content);
```

百度UEditor编辑器上传服务端配置:
--------------------

[](#百度ueditor编辑器上传服务端配置)

### 引入文件:

[](#引入文件-1)

```
use Hahadu\ThinkEditor\Client\UEditor;
$UE = new UEditor();
return $UE->ueditor();
```

然后模板文件：

```

var ue = UE.getEditor("container",{
initialFrameHeight:500,
allowDivTransToP: false,
serverUrl : "{:url('ueditor')}",//路由地址
});

```

配置：
---

[](#配置)

在系统config配置文件夹中配置ueditor编辑器和水印文件

> config
>
> > editor.php //编辑器配置文件 water.php //水印配置文件

详情参考config目录下ueditor.php和water.php

- 水印需要 php-imagick 支持：debian\\ubuntu : sudo apt install php-imagick

#### 鸣谢

[](#鸣谢)

> [hahadu/image-factory](https://github.com/hahadu/image-factory) 提供的图像处理模块
>
> [hahadu/helper-function](https://github.com/hahadu/helper-function) 一些助手函数
>
> [hahadu/think-helper](https://github.com/hahadu/think-helper) 另外一些助手函数
>
> [hahadu/wangEditor-editor-code](https://github.com/hahadu/wangEditor-editor-code) wangEditor源代码编辑插件
>
> 交流qq群 \[(点击链接加入群聊【thinkphp6开发交流群】：839695142\][https://jq.qq.com/?\_wv=1027&amp;k=FxgUKLhJ](https://jq.qq.com/?_wv=1027&k=FxgUKLhJ))

### 其它项目

[](#其它项目)

> [hahadu/im-admin-think](https://github.com/hahadu/im-admin-think) admin模块
>
> [hahadu/im-blog-think](https://github.com/hahadu/im-blog-think) think-php博客/文章管理、发布模块

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity39

Early-stage or recently created project

 Bus Factor1

Top contributor holds 100% 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 ~4 days

Total

3

Last Release

1862d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8803f4b62a77e88a2b14f57d7d68a5bacaa69fd8c58b17101e89044fab8abb27?d=identicon)[hahadu](/maintainers/hahadu)

---

Top Contributors

[![hahadu](https://avatars.githubusercontent.com/u/38153732?v=4)](https://github.com/hahadu "hahadu (13 commits)")

### Embed Badge

![Health badge](/badges/hahadu-think-editor/health.svg)

```
[![Health](https://phpackages.com/badges/hahadu-think-editor/health.svg)](https://phpackages.com/packages/hahadu-think-editor)
```

PHPackages © 2026

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