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?
已存档?
是复刻?
已锁定?
是镜像?
是私有?