Skip to content

Commit

Permalink
Merge pull request #11 from alexantr/master
Browse files Browse the repository at this point in the history
Yes, Clipboard Upload deprecated on version 10.0.x
I will modify imageGetJson and fileGetJson action.
Greet pull
  • Loading branch information
zinzinday committed Jan 14, 2015
2 parents c1089c8 + c11a6af commit 4549163
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 89 deletions.
16 changes: 16 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# phpstorm project files
.idea

# netbeans project files
nbproject

# zend studio for eclipse project files
.buildpath
.project
.settings

# composer itself is not needed
composer.phar

# Mac DS_Store Files
.DS_Store
46 changes: 19 additions & 27 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ Either run

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

or
Expand All @@ -27,22 +26,20 @@ Configure
Add to config file (config/web.php or common\config\main.php)

```
'modules' => [
'redactor' => 'yii\redactor\RedactorModule',
],
'modules' => [
'redactor' => 'yii\redactor\RedactorModule',
],
```
or if you want to change the upload directory.
to path/to/uploadfolder
default value `@webroot/uploads`

```
'modules' => [
'modules' => [
'redactor' => [
'class'=>'yii\redactor\RedactorModule',
'uploadDir'=>'@webroot/path/to/uploadfolder'
'uploadUrl'=>'http://domain/path/to/uploadfolder'
'class' => 'yii\redactor\RedactorModule',
'uploadDir' => '@webroot/path/to/uploadfolder'
'uploadUrl' => 'http://domain/path/to/uploadfolder'
],
],
```
Expand All @@ -54,36 +51,31 @@ reference: [Protect Your Uploads Folder with .htaccess](http://tomolivercv.wordp
Config view/form

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

or not use ActiveField

```
<?=
\yii\redactor\widgets\Redactor::widget([
'model' => $model,
'attribute'=>'body'
])
?>
<?= \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'=>[
'imageGetJson' => '/redactor/upload/imagejson',
'imageUpload' => '/redactor/upload/image',
'clipboardUploadUrl' => '/redactor/upload/clipboard',
'fileUpload' => '/redactor/upload/file',
'lang'=>'zh_cn',
'plugins'=>['clips','fontcolor']
<?= $form->field($model, 'body')->widget(\yii\redactor\widgets\Redactor::className(), [
'clientOptions' => [
'imageManagerJson' => \yii\helpers\Url::toRoute('/redactor/upload/imagejson'),
'imageUpload' => \yii\helpers\Url::toRoute('/redactor/upload/image'),
'fileUpload' => \yii\helpers\Url::toRoute('/redactor/upload/file'),
'lang' => 'zh_cn',
'plugins' => ['clips', 'fontcolor']
]
])?>
```


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/yiidoc/yii2-redactor/issues)

Expand Down
60 changes: 0 additions & 60 deletions actions/ClipboardUploadAction.php

This file was deleted.

3 changes: 1 addition & 2 deletions widgets/Redactor.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ class Redactor extends InputWidget

public $options = [];
public $clientOptions = [
'imageGetJson' => '/redactor/upload/imagejson',
'imageManagerJson' => '/redactor/upload/imagejson',
'imageUpload' => '/redactor/upload/image',
'clipboardUploadUrl' => '/redactor/upload/clipboard',
'fileUpload' => '/redactor/upload/file'
];
private $_assetBundle;
Expand Down

0 comments on commit 4549163

Please sign in to comment.