PHP code example of andrewdanilov / yii2-ckeditor

1. Go to this page and download the library: Download andrewdanilov/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/ */

    

andrewdanilov / yii2-ckeditor example snippets


use andrewdanilov\ckeditor\CKEditor;

echo CKEditor::widget();

use andrewdanilov\ckeditor\CKEditor;

echo $form->field($post, 'text_full')->widget(CKEditor::className());

echo $form->field($post, 'text_full')->widget(CKEditor::className(), [
    'extraPlugins' => [
        ['test', '@root/uploads/plugins/test-plugin/', 'plugin.js']
    ],
    'editorOptions' => [
        'toolbar' => [
            ['Source', 'NewPage', 'Preview', 'Viewss'],
            ['PasteText', '-', 'Undo', 'Redo'],
            ['Replace', 'SelectAll', 'Scayt'],
            ['Format', 'FontSize'],
            ['Bold', 'Italic', 'Underline', 'TextColor', 'StrikeThrough', '-', 'Outdent', 'Indent', 'RemoveFormat',
                'Blockquote', 'HorizontalRule'],
            ['NumberedList', 'BulletedList', '-', 'JustifyLeft', 'JustifyCenter', 'JustifyRight',
                'JustifyBlock'],
            ['Image', 'oembed', 'Video', 'Iframe'],
            ['Link', 'Unlink'],
            ['Maximize', 'ShowBlocks'],
            ['test']
        ],
        'allowedContent' => true,
        'forcePasteAsPlainText' => true,
        'extraPlugins' => 'test,image2,widget,oembed,video',
        'language' => Yii::$app->language,
        'height' => 500
    ],
]);