yiidoc/yii2-redactor
最新稳定版本:2.0.1
Composer 安装命令:
composer require yiidoc/yii2-redactor
包简介
Extension redactor for Yii2 Framework.
README 文档
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!
统计信息
- 总下载量: 602.48k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 191
- 点击次数: 1
- 依赖项目数: 60
- 推荐数: 1
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2014-03-03