https://github.com/zacksleo/yii2-ueditor
yii2 ueditor extend
https://github.com/zacksleo/yii2-ueditor
ueditor yii2-extension yii2-ueditor
Last synced: about 1 month ago
JSON representation
yii2 ueditor extend
- Host: GitHub
- URL: https://github.com/zacksleo/yii2-ueditor
- Owner: zacksleo
- Created: 2017-02-23T10:06:20.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-09-16T07:46:07.000Z (over 8 years ago)
- Last Synced: 2025-02-09T22:30:31.516Z (over 1 year ago)
- Topics: ueditor, yii2-extension, yii2-ueditor
- Language: PHP
- Size: 12.7 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## Yii2 135编辑/秀米编辑器器扩展
[](https://packagist.org/packages/zacksleo/yii2-ueditor)
[](https://packagist.org/packages/zacksleo/yii2-ueditor)
[](https://packagist.org/packages/zacksleo/yii2-ueditor)
[]()
[](https://travis-ci.org/zacksleo/yii2-ueditor)
[]()
[]()
[]()
该插件根据[135编辑器企业插件](http://www.135plat.com/135_ueditor_plugin.html)
和[秀米编辑器Ueditor插件](http://hgs.xiumi.us/uedit/)封装而来
## 用法
### 1. 在 config/main 中配置 module 为:
```
'ueditor' => [
'class' => 'zacksleo\yii2\ueditor\Module'
]
```
### 2. 在页面中使用
加载135编辑器插件:
```
use zacksleo\yii2\ueditor\assets\Editor135Asset;
Editor135Asset::register($this);
$this->registerJsFile('/admin/ueditor/i25/script',[
'depends'=>[
'kucha\ueditor\UeditorAsset'
]
]);
echo \kucha\ueditor\UEditor::widget([
'name' => 'ueditor',
'clientOptions' => [
//编辑区域大小
'initialFrameHeight' => '200',
//设置语言
'lang' => 'zh-cn', //中文为 zh-cn
'zIndex' => '9995',
//定制菜单
'toolbars' => [
[
'fullscreen', 'source', 'undo', 'redo', '|',
'fontsize',
'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'removeformat',
'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|',
'forecolor', 'backcolor', '|',
'lineheight', '|',
'indent', '|', '135editor'
],
]
]
]);
```
加载秀米编辑器插件:
```
use zacksleo\yii2\ueditor\assets\EditorXiumiAsset;
EditorXiumiAsset::register($this);
$this->registerJsFile('/admin/ueditor/xiumi/script',[
'depends'=>[
'kucha\ueditor\UeditorAsset'
]
]);
echo \kucha\ueditor\UEditor::widget([
'name' => 'ueditor',
'clientOptions' => [
//编辑区域大小
'initialFrameHeight' => '200',
//设置语言
'lang' => 'zh-cn', //中文为 zh-cn
'zIndex' => '9995',
//定制菜单
'toolbars' => [
[
'fullscreen', 'source', 'undo', 'redo', '|',
'fontsize',
'bold', 'italic', 'underline', 'fontborder', 'strikethrough', 'removeformat',
'formatmatch', 'autotypeset', 'blockquote', 'pasteplain', '|',
'forecolor', 'backcolor', '|',
'lineheight', '|',
'indent', '|', '135editor'
],
]
]
]);
```
### 3. 更多关于 \kucha\ueditor\UEditor 的用法见[文档](https://github.com/BigKuCha/yii2-ueditor-widget)