3 namespace Drupal\{{ machine_name }}\Plugin\CKEditorPlugin;
5 use Drupal\ckeditor\CKEditorPluginBase;
6 use Drupal\editor\Entity\Editor;
9 * Defines the "{{ plugin_label }}" plugin.
12 * id = "{{ plugin_id }}",
13 * label = @Translation("{{ plugin_label }}"),
14 * module = "{{ machine_name }}"
17 class {{ class }} extends CKEditorPluginBase {
22 public function getFile() {
23 return drupal_get_path('module', '{{ machine_name }}') . '/js/plugins/{{ short_plugin_id }}/plugin.js';
29 public function getConfig(Editor $editor) {
36 public function getButtons() {
37 $module_path = drupal_get_path('module', '{{ machine_name }}');
39 '{{ short_plugin_id }}' => [
40 'label' => $this->t('{{ plugin_label }}'),
41 'image' => $module_path . '/js/plugins/{{ short_plugin_id }}/icons/{{ short_plugin_id }}.png',