kosoukhov / yii2-ckeditor-youtube-plugin
Yii2 Youtube embed plugin for CKEditor based on Youtube embed (https://github.com/fonini/ckeditor-youtube-plugin/releases/tag/v2.1.18)
Installs: 550
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 1
Type:yii2-extension
Requires
- ckeditor/ckeditor: ^4
- yiisoft/yii2: ~2.0.0
This package is auto-updated.
Last update: 2024-11-13 18:29:15 UTC
README
Yii2 YouTube embed plugin (as widget) for CKEditor based on YouTube embed
Based on YouTube embed https://github.com/fonini/ckeditor-youtube-plugin/releases/tag/v2.1.18
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require kosoukhov/yii2-ckeditor-youtube-plugin "^1.0"
or add
"kosoukhov/yii2-ckeditor-youtube-plugin": "^1.0"
to the require section of your composer.json
file.
Usage example:
Once the widget is installed, use it in your code.
You must specify in the plugin dependencies the set of editor Asset to which you connect the plugin.
If you are using the https://github.com/2amigos/yii2-ckeditor-widget then an example code like this:
class SetUp implements BootstrapInterface { public function bootstrap($app) { $container = Yii::$container; $container->set(YoutubeEmbed::class, ['depends' => ['dosamigos\ckeditor\CKEditorWidgetAsset']]); $container->set(CKEditor::class, [ 'preset' => 'standart', 'clientOptions' => [ 'extraPlugins' => $container->get(YoutubeEmbed::class)::getPluginName() ] ]); } }
If you are using the https://github.com/MihailDev/yii2-ckeditor then an example code like this:
class SetUp implements BootstrapInterface { public function bootstrap($app) { $container = Yii::$container; $container->set(YoutubeEmbed::class, ['depends' => ['mihaildev\ckeditor\Assets']]); $container->set(CKEditor::class, [ 'editorOptions' => [ 'extraPlugins' => $container->get(YoutubeEmbed::class)::getPluginName() ] ]); } }