bajadev/yii2-ckeditor

Yii2 CKEditor

Installs: 31 220

Dependents: 1

Suggesters: 0

Security: 0

Stars: 2

Watchers: 4

Forks: 68

Language:JavaScript

Type:yii2-extension

1.3.3 2018-04-16 06:26 UTC

This package is not auto-updated.

Last update: 2024-05-01 00:27:46 UTC


README

CKEditor for Yii2 with file manager & upload

Install with composer:

"bajadev/yii2-ckeditor": "*"

or

composer require bajadev/yii2-ckeditor "*"

Controller:

public function actions()
{

    return [
        'browse-images' => [
            'class' => 'bajadev\ckeditor\actions\BrowseAction',
            'quality' => 80,
            'maxWidth' => 800,
            'maxHeight' => 800,
            'useHash' => true,
            'url' => '@web/contents/',
            'path' => '@frontend/web/contents/',
        ],
        'upload-images' => [
            'class' => 'bajadev\ckeditor\actions\UploadAction',
            'quality' => 80,
            'maxWidth' => 800,
            'maxHeight' => 800,
            'useHash' => true,
            'url' => '@web/contents/',
            'path' => '@frontend/web/contents/',
        ],
    ];
}

View:

    <?php echo $form->field($model, 'content')->widget(CKEditor::className(), [
        'editorOptions' => [
            'preset' => 'full', /* basic, standard, full
            'inline' => false,
            'filebrowserBrowseUrl' => 'browse-images',
            'filebrowserUploadUrl' => 'upload-images',
            'extraPlugins' => 'imageuploader',
        ],
    ]); ?>