项目作者: krissss

项目描述 :
Yii2 wangEditor widget
高级语言: PHP
项目地址: git://github.com/krissss/yii2-wang-editor.git
创建时间: 2017-08-31T07:37:13Z
项目社区:https://github.com/krissss/yii2-wang-editor

开源协议:

下载


Yii2 wangEditor widget

Yii2 wangEditor widget

v2.x 与 v1.x 版本之间存在差异,升级请注意

wangEditor 官网

安装

  1. composer require kriss/yii2-wang-editor

使用

widget

  1. <?php
  2. use kriss\wangEditor\widgets\WangEditorWidget;
  3. echo WangEditorWidget::widget([
  4. 'name' => 'inputName',
  5. //'canFullScreen' => true, // 增加全屏的按钮
  6. //'customConfig' => [], // 扩展配置
  7. ]);
  8. // or
  9. echo $form->field($model, 'content')->widget(WangEditorWidget::class, [
  10. //'canFullScreen' => true,
  11. ]);

action

  1. <?php
  2. namespace admin\controllers;
  3. use yii\web\Controller;
  4. use kriss\wangEditor\actions\UploadAction;
  5. class FileController extends Controller
  6. {
  7. public function actions()
  8. {
  9. return [
  10. 'wang-editor' => [
  11. 'class' => UploadAction::class,
  12. 'savePath' => '@webroot/uploads',
  13. 'displayPath' => '@web/uploads',
  14. ],
  15. ];
  16. }
  17. }