shiyang/yii2-umeditor

UMeditor is a simple version ueditor.

Installs: 287

Dependents: 0

Suggesters: 0

Security: 0

Stars: 8

Watchers: 3

Forks: 5

Open Issues: 0

Language:JavaScript

Type:yii2-extension

pkg:composer/shiyang/yii2-umeditor

v1.2 2016-02-01 10:47 UTC

This package is not auto-updated.

Last update: 2025-09-27 23:15:49 UTC


README

UMeditor is a simple version ueditor.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist shiyang/yii2-umeditor "*"

or add

"shiyang/yii2-umeditor": "*"

to the require section of your composer.json file.

Usage

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

controller:

public function actions()
{
    return [
        'upload' => [
            'class' => 'shiyang\umeditor\UMeditorAction',
        ]
    ];
}

view:

<?php $form = ActiveForm::begin(); ?>

<?= $form->field($model, 'content')->widget('shiyang\umeditor\UMeditor', [
    'clientOptions' => [
        'initialFrameHeight' => 100,
        'toolbar' => [
            'source | undo redo | bold |',
            'link unlink | emotion image video |',
            'justifyleft justifycenter justifyright justifyjustify |',
            'insertorderedlist insertunorderedlist |' ,
            'horizontal preview fullscreen',
        ],
    ]
])->label(false) ?>

<div class="form-group">
    <?= Html::submitButton('Create', ['class' => 'btn btn-primary']) ?>
</div>

<?php ActiveForm::end(); ?>

Further Information

Please, check the Umeditor plugin site or config documentation for further information about its configuration options.

Demo

See umeditor