yiidoc/yii2-redactor

Extension redactor for Yii2 Framework.

Maintainers

👁 zinzinday

Package info

github.com/yiidoc/yii2-redactor

Wiki

Language:JavaScript

Type:yii2-extension

pkg:composer/yiidoc/yii2-redactor

Statistics

Installs: 637 113

Dependents: 60

Suggesters: 1

Stars: 185

Open Issues: 52

2.0.1 2015-06-02 21:47 UTC

Requires

Requires (Dev)

None

Suggests

None

Provides

None

Conflicts

None

Replaces

None

BSD-3-Clause c4c80c19c68728e88d135f4eec5c51352fbbaa37

  • Nghia Nguyen <zinzinday.woop@gmail.com>

wysiwygextensionRedactorhtml editoryii2imperavi

This package is auto-updated.

Last update: 2026-06-25 11:02:36 UTC


README

Extension redactor for Yii2 Framework.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist yiidoc/yii2-redactor "*"

or

 "yiidoc/yii2-redactor": "*"

to the require section of your composer.json.

Configure

Add to config file (config/web.php or common\config\main.php)

 'modules' => [
 'redactor' => 'yii\redactor\RedactorModule',
 ],

or if you want to change the upload directory. to path/to/uploadfolder default value @webroot/uploads

 'modules' => [
 'redactor' => [
 'class' => 'yii\redactor\RedactorModule',
 'uploadDir' => '@webroot/path/to/uploadfolder',
 'uploadUrl' => '@web/path/to/uploadfolder',
 'imageAllowExtensions'=>['jpg','png','gif']
 ],
 ],

note: You need to create uploads folder and chmod and set security for folder upload reference: Protect Your Uploads Folder with .htaccess, How to Setup Secure Media Uploads

Config view/form

<?= $form->field($model, 'body')->widget(\yii\redactor\widgets\Redactor::className()) ?>

or not use ActiveField

<?= \yii\redactor\widgets\Redactor::widget([
 'model' => $model,
 'attribute' => 'body'
]) ?>

or config advanced redactor reference Docs

<?= $form->field($model, 'body')->widget(\yii\redactor\widgets\Redactor::className(), [
 'clientOptions' => [
 'imageManagerJson' => ['/redactor/upload/image-json'],
 'imageUpload' => ['/redactor/upload/image'],
 'fileUpload' => ['/redactor/upload/file'],
 'lang' => 'zh_cn',
 'plugins' => ['clips', 'fontcolor','imagemanager']
 ]
])?>

Bummer! i was tested on my project but not have many time to write document on file and usage. If you have problem please create a issue

Thanks!