PHP code example of alexantr / yii2-ckeditor

1. Go to this page and download the library: Download alexantr/yii2-ckeditor library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

alexantr / yii2-ckeditor example snippets


<?= alexantr\ckeditor\CKEditor::widget(['name' => 'attributeName']) 

<?= alexantr\ckeditor\CKEditor::widget([
    'name' => 'attributeName',
    'clientOptions' => [
        'extraPlugins' => 'autogrow,colorbutton,colordialog,iframe,justify,showblocks',
        'removePlugins' => 'resize',
        'autoGrow_maxHeight' => 900,
        'stylesSet' => [
            ['name' => 'Subscript', 'element' => 'sub'],
            ['name' => 'Superscript', 'element' => 'sup'],
        ],
    ],
]) 

<?= $form->field($model, 'attributeName')->widget(alexantr\ckeditor\CKEditor::className()) 

<?= alexantr\ckeditor\CKEditor::widget([
    'name' => 'attributeName',
    'presetPath' => '@backend/config/my-ckeditor-config.php',
])