dev-master
9999999-devYii2 CKEditor
The Requires
- php >=5.4.0
- yiisoft/yii2 *
yii ckeditor editor wysiwyg
Wallogit.com
2017 © Pedro Peláez
Yii2 CKEditor
This is a fork MihailDev/yii2-ckeditor, (*1)
Plugins: - Line Utilities - Widget - oembed - Custom video (MP4, WebM) - Enhanced Image, (*2)
The preferred way to install this extension is through Composer., (*3)
Either run php composer.phar require sadovojav/yii2-ckeditor "dev-master", (*4)
or add "sadovojav/yii2-ckeditor": "dev-master" to the require section of your composer.json, (*5)
use sadovojav\ckeditor\CKEditor; echo CKEditor::widget();
use sadovojav\ckeditor\CKEditor; echo $form->field($post, 'text_full')->widget(CKEditor::className());
editorOptions - CKeditor optionscontainerOptions - Container optionsextraPlugins - Extra plugins connectioninitOnEvent = false - Event type for initializationecho $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
],
]);
'initOnEvent' => 'focus' //dblclick, mouseover, etc.
'extraPlugins' => [
['test', '@root/uploads/plugins/test-plugin/', 'plugin.js']
],
test required - plugin name@root/uploads/plugins/test-plugin/ required - path to pluginplugin.js required - plugin script file'extraPlugins' => 'test,image2,oembed,widget,video',
Without space after comma., (*6)
'toolbar' => [
['test'],
],
Yii2 CKEditor
yii ckeditor editor wysiwyg