1 {% extends "base/class.php.twig" %}
4 \Drupal\{{ module }}\Plugin\CKEditorPlugin\{{ class_name }}.
7 {% block namespace_class %}
8 namespace Drupal\{{ module }}\Plugin\CKEditorPlugin;
12 use Drupal\ckeditor\CKEditorPluginBase;
13 use Drupal\editor\Entity\Editor;
16 {% block class_declaration %}
18 * Defines the "{{ plugin_id }}" plugin.
20 * NOTE: The plugin ID ('id' key) corresponds to the CKEditor plugin name.
21 * It is the first argument of the CKEDITOR.plugins.add() function in the
25 * id = "{{ plugin_id }}",
26 * label = @Translation("{{ label }}")
29 class {{ class_name }} extends CKEditorPluginBase {% endblock %}
30 {% block class_methods %}
35 * NOTE: The keys of the returned array corresponds to the CKEditor button
36 * names. They are the first argument of the editor.ui.addButton() or
37 * editor.ui.addRichCombo() functions in the plugin.js file.
39 public function getButtons() {
40 // Make sure that the path to the image matches the file structure of
41 // the CKEditor plugin you are implementing.
43 '{{ button_name }}' => [
44 'label' => t('{{ label }}'),
45 'image' => '{{ button_icon_path }}',
53 public function getFile() {
54 // Make sure that the path to the plugin.js matches the file structure of
55 // the CKEditor plugin you are implementing.
56 return drupal_get_path('module', '{{ module }}') . '/js/plugins/{{ plugin_id }}/plugin.js';
62 public function isInternal() {
69 public function getDependencies(Editor $editor) {
76 public function getLibraries(Editor $editor) {
83 public function getConfig(Editor $editor) {