kak/ckeditor

Yii2 ckeditor widget

dev-master 2016-10-11 13:55 UTC

This package is auto-updated.

Last update: 2024-10-22 06:17:58 UTC


README

Yii2 ckeditor widget.

Installation

Composer

The preferred way to install this extension is through Composer.

Either run

php composer.phar require kak/ckeditor "dev-master"

or add

"kak/ckeditor": "dev-master"

to the require section of your composer.json

Usage

	<?= $form->field($model, 'content')->widget(kak\widgets\ckeditor\CKEditor::className(), [
		'clientOptions' => [
			...
		]
	]) ?>

or

	<?= kak\widgets\ckeditor\CKEditor::widget([
		'name' => 'editor_id',
		'clientOptions' => [
			...
		]
	]) ?>

See clientOptions

##Configuration Browser plugin (File browser for ckeditor) add section array to file config\params.php

//...
      'ckeditor' => [
            'browser' => [
                'url' => ['site/browser'], 
                'dirs' => [ 
                    'web dir ' => '@webroot'   // allow dirs
                ],
            ]
        ]
//...      

Create method the SiteController

    public function actions()
    {
        return [
            'browser' => [
                'class' => '\kak\widgets\ckeditor\actions\Browser',
            ],
        ];
    }