PHP code example of maxwen / yii2-ckeditor-widget

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

    

maxwen / yii2-ckeditor-widget example snippets

 

 
use maxwen\ckeditor\CKEditorInline;

// First we need to tell CKEDITOR variable where is our external plufin 
$this->registerJs("CKEDITOR.plugins.addExternal('pbckcode', '/pbckcode/plugin.js', '');");

// ... 
// Using the plugin
 CKEditorInline::begin(['preset' => 'custom', 'clientOptions' => [
    'extraPlugins' => 'pbckcode',
    'toolbarGroups' => [
        ['name' => 'undo'],
        ['name' => 'basicstyles', 'groups' => ['basicstyles', 'cleanup']],
        ['name' => 'colors'],
        ['name' => 'links', 'groups' => ['links', 'insert']],
        ['name' => 'others', 'groups' => ['others', 'about']],
        
        ['name' => 'pbckcode'] // <--- OUR NEW PLUGIN YAY!
    ]
]]) 

 // CKEditor config rewrite
'ckeditorConfig' => [
		// custom options
		'language'   => 'en',
		'font_names' => 'Arial;Comic Sans MS;Courier New;Tahoma;Times New Roman;Verdana',
		'toolbar'    => 'Full',
		'skin'       => 'your skin name here'
		// etc...
	],
	


use maxwen\ckeditor\CKEditorInline;

 CKEditorInline::begin([
	'editorConfig' => [
		// ...
	]
	]);