Yii2 ckeditor widget., (*1)
Installation
Composer
The preferred way to install this extension is through Composer., (*2)
Either run, (*3)
php composer.phar require kak/ckeditor "dev-master"
or add, (*4)
"kak/ckeditor": "dev-master"
to the require section of your composer.json, (*5)
Usage
<?= $form->field($model, 'content')->widget(kak\widgets\ckeditor\CKEditor::className(), [
'clientOptions' => [
...
]
]) ?>
or, (*6)
<?= kak\widgets\ckeditor\CKEditor::widget([
'name' => 'editor_id',
'clientOptions' => [
...
]
]) ?>
See clientOptions, (*7)
Configuration Browser plugin (File browser for ckeditor)
add section array to file config\params.php, (*8)
//...
'ckeditor' => [
'browser' => [
'url' => ['site/browser'],
'dirs' => [
'web dir ' => '@webroot' // allow dirs
],
]
]
//...
Create method the SiteController, (*9)
public function actions()
{
return [
'browser' => [
'class' => '\kak\widgets\ckeditor\actions\Browser',
],
];
}