CKEditor Extension for Yii 2
CKEditor — a free WYSIWYG editor that can be used on web pages., (*1)
Installation
The easiest way to install this extension is via [composer] (http://getcomposer.org/download/)., (*2)
Either run, (*3)
composer require webschool/yii2-ckeditor
or add, (*4)
"webschool/yii2-ckeditor": "^1.*"
in the require section of your composer.json file., (*5)
Using
use webschool\ckeditor\CKEditor;
use yii\helpers\Html;
CKEditor::widget([
'editorOptions' => [
'preset' => 'full', // basic, standard, full
]
]);
//или c ActiveForm
echo $form->field($model, 'content')->widget(CKEditor::className(),[
'editorOptions' => [
'preset' => 'full', // basic, standard, full
],
]);
Configuring CkFinder
If you are using the yii2 advanced package:, (*6)
In order to use your settings, copy the file "vendor/webschool/yii2-ckeditor/editor/plugins/ckfinder/config.php" to "backend/config/ckfinder/config.php".
In "backend/config/ckfinder/config.php", remove all references to the variable "localConfig"., (*7)
Useful links
CKEditor Api - http://docs.ckeditor.com/, (*8)
CKEditor Примеры - http://nightly.ckeditor.com/, (*9)