kriss/yii2-wang-editor

Yii2 wangEditor widget

Installs: 1 180

Dependents: 0

Suggesters: 0

Security: 0

Stars: 9

Watchers: 3

Forks: 1

Open Issues: 0

Type:yii2-extension

v2.2 2019-04-28 01:18 UTC

This package is auto-updated.

Last update: 2024-10-28 14:22:22 UTC


README

Yii2 wangEditor widget

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

wangEditor 官网

安装

composer require kriss/yii2-wang-editor

使用

widget

<?php
use kriss\wangEditor\widgets\WangEditorWidget;

echo WangEditorWidget::widget([
    'name' => 'inputName',
    //'canFullScreen' => true, // 增加全屏的按钮
    //'customConfig' => [], // 扩展配置
]);
// or
echo $form->field($model, 'content')->widget(WangEditorWidget::class, [
    //'canFullScreen' => true,
]);

action

<?php

namespace admin\controllers;

use yii\web\Controller;
use kriss\wangEditor\actions\UploadAction;

class FileController extends Controller
{
    public function actions()
    {
        return [
            'wang-editor' => [
                'class' => UploadAction::class,
                'savePath' => '@webroot/uploads',
                'displayPath' => '@web/uploads',
            ],
        ];
    }
}