PHP code example of 2amigos / yii2-ckeditor-widget
1. Go to this page and download the library: Download 2amigos/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/ */
2amigos / yii2-ckeditor-widget example snippets
use dosamigos\ckeditor\CKEditorInline;
// First we need to tell CKEDITOR variable where is our external plugin
$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!
]
]])
use dosamigos\ckeditor\CKEditor;
echo $form->field($model, 'text')->widget(CKEditor::className(), [
'kcfinder' => true,
]);