dev-master
9999999-devExtension redactor for Yii2 Framework.
BSD-3-Clause
The Requires
by Nghia Nguyen
by Popov Denis
extension yii2 wysiwyg imperavi redactor html editor
Extension redactor for Yii2 Framework.
The preferred way to install this extension is through composer., (*1)
Either run, (*2)
php composer.phar require --prefer-dist "karneds/yii2-redactor *"
or add, (*3)
"karneds/yii2-redactor": "*"
to the require section of your composer.json., (*4)
public function actions(){ return [ 'file' => [ 'class'=>'yii\redactor\actions\FileUploadAction', 'uploadDir'=>'@webroot/uploads/files/' ], 'image' => [ 'class'=>'yii\redactor\actions\ImageUploadAction', 'uploadDir'=>'@webroot/uploads/images/' ], 'imagejson' => [ 'class'=>'yii\redactor\actions\ImageGetJsonAction', 'sourcePath'=>'@webroot/uploadsimages/' ], 'clipboard' => [ 'class'=>'yii\redactor\actions\ClipboardUploadAction', 'uploadDir'=>'@webroot/uploads/files/' ], ]; }
use \yii\helpers\Url; ... = $form->field($model,'text')->widget(yii\redactor\widgets\Redactor::className(),[ 'clientOptions'=>[ 'lang'=>'ru', 'formattingTags'=>['p', 'blockquote', 'pre', 'h2', 'h3', 'h4'], 'imageTabLink'=>false, 'imageGetJson' => Url::toRoute(['pages/imagejson']), 'imageUpload' => Url::toRoute(['pages/image']), 'clipboardUploadUrl' =>Url::toRoute(['pages/clipboard']), 'fileUpload' => Url::toRoute(['pages/file']), 'plugins' => ['clips', 'fullscreen'] ] ])?>
'components' => [ 'urlManagerFrontend'=>[ 'class' => 'yii\web\UrlManager', 'baseUrl'=>'', 'hostInfo'=>'http://example.com' ], ]
public function actions(){ return [ 'image' => [ 'class'=>'yii\redactor\actions\ImageUploadAction', 'uploadDir'=>'@frontend/web/uploads/images/', 'baseDir'=>'@frontend/web', 'baseUrl'=>Yii::$app->urlManagerFrontend->hostInfo.Yii::$app->urlManagerFrontend->baseUrl ], 'imagejson' => [ 'class'=>'yii\redactor\actions\ImageGetJsonAction', 'sourcePath'=>'@frontend/web/uploads/images/' 'baseDir'=>'@frontend/web', 'baseUrl'=>Yii::$app->urlManagerFrontend->hostInfo.Yii::$app->urlManagerFrontend->baseUrl ], ]; }
```php use \yii\helpers\Url; ... = $form->field($model,'text')->widget(yii\redactor\widgets\Redactor::className(),[ 'clientOptions'=>[ 'lang'=>'ru', 'imageGetJson' => Url::toRoute(['pages/imagejson']), 'imageUpload' => Url::toRoute(['pages/image']) ] ])?>, (*5)
Extension redactor for Yii2 Framework.
BSD-3-Clause
extension yii2 wysiwyg imperavi redactor html editor