Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ommu/yii2-redactor
Extension Redactor WYSIWYG for Yii2 framework
https://github.com/ommu/yii2-redactor
imperavi imperavi-redactor redactor wysiwyg yii2 yii2-extension
Last synced: 3 months ago
JSON representation
Extension Redactor WYSIWYG for Yii2 framework
- Host: GitHub
- URL: https://github.com/ommu/yii2-redactor
- Owner: ommu
- License: apache-2.0
- Fork: true (yiidoc/yii2-redactor)
- Created: 2018-05-21T05:12:43.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-12-10T14:36:56.000Z (about 1 year ago)
- Last Synced: 2024-09-19T08:16:03.068Z (4 months ago)
- Topics: imperavi, imperavi-redactor, redactor, wysiwyg, yii2, yii2-extension
- Language: JavaScript
- Homepage:
- Size: 1.03 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
yii2-redactor
=============
Extension redactor for Yii2 Framework.Installation
------------The preferred way to install this extension is through [composer](http://getcomposer.org/download/).
Either run
```
php composer.phar require --prefer-dist ommu/yii2-redactor "*"
```or
```
"ommu/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](http://tomolivercv.wordpress.com/2011/07/24/protect-your-uploads-folder-with-htaccess/),
[How to Setup Secure Media Uploads](http://digwp.com/2012/09/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](http://imperavi.com/redactor/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']
]
])?>
```change default subfolder - optional, name subfolder only [a-zA-Z]
```
= $form->field($model, 'body')->widget(\yii\redactor\widgets\Redactor::className(), [
'clientOptions' => [
'imageManagerJson' => ['/redactor/upload/image-json', 'subfolder' => 'news'],
'imageUpload' => ['/redactor/upload/image', 'subfolder' => 'news'],
'fileUpload' => ['/redactor/upload/file', 'subfolder' => 'news'],
'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](https://github.com/ommu/yii2-redactor/issues)Thanks!