yii2-redactor

用于Yii2框架的Redactor WYSIWYG扩展。(Extension Redactor WYSIWYG for Yii2 framework)

  • 所有者: yiidoc/yii2-redactor
  • 平台: BSD, Linux, Mac, Windows
  • 許可證: BSD 3-Clause "New" or "Revised" License
  • 分類:
  • 主題:
  • 喜歡:
    0
      比較:

Github星跟蹤圖

yii2-redactor

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!

主要指標

概覽
名稱與所有者yiidoc/yii2-redactor
主編程語言JavaScript
編程語言PHP (語言數: 3)
平台BSD, Linux, Mac, Windows
許可證BSD 3-Clause "New" or "Revised" License
所有者活动
創建於2013-09-19 21:15:46
推送於2022-04-15 01:47:07
最后一次提交2016-01-07 13:45:09
發布數2
最新版本名稱2.0.1 (發布於 )
第一版名稱2.0.0 (發布於 )
用户参与
星數186
關注者數20
派生數87
提交數44
已啟用問題?
問題數78
打開的問題數49
拉請求數6
打開的拉請求數3
關閉的拉請求數7
项目设置
已啟用Wiki?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?