yuncms/yii2-ueditor-widget

The UEditor extension for the Yii framework

Installs: 248

Dependents: 2

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

Open Issues: 0

Language:JavaScript

Type:yii2-extension

1.0.0.3 2017-11-14 06:47 UTC

This package is auto-updated.

Last update: 2022-05-10 21:36:40 UTC


README

适用于 Yii2 的百度 UEditor

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist yuncms/yii2-ueditor-widget "*"

or add

"yuncms/yii2-ueditor-widget": "*"

to the require section of your composer.json file.

Usage

<?php

namespace app\controllers;

use Yii;
use yii\web\Controller;
use yii\filters\AccessControl;

class MyController extends Controller
{

    /** @inheritdoc */
    public function behaviors()
    {
        return [
            'access' => [
                'class' => AccessControl::className(),
                'rules' => [
                    [
                        'allow' => true,
                        'actions' => [
                            'upload'
                        ],
                        'roles' => ['@'],
                    ],
                ],
            ],
        ];
    }

    public function actions()
    {
        return [
            'upload' => [
                'class' => 'yuncms\ueditor\UEditorAction',
                //etc...
            ],
        ];
    }
}

Once the extension is installed, simply use it in your code by :

<?= $form->field($model, 'content')->widget(\yuncms\ueditor\UEditor::className(),[
	//etc...
]) ?>
<?= \yuncms\ueditor\UEditor::widget(); ?>