You are here

public function AbbreviationCKEditorButton::getButtons in CKEditor Abbreviation 8

Same name and namespace in other branches
  1. 2.0.x src/Plugin/CKEditorPlugin/AbbreviationCKEditorButton.php \Drupal\ckeditor_abbreviation\Plugin\CKEditorPlugin\AbbreviationCKEditorButton::getButtons()

NOTE: The keys of the returned array corresponds to the CKEditor button names. They are the first argument of the editor.ui.addButton() or editor.ui.addRichCombo() functions in the plugin.js file.

Overrides CKEditorPluginButtonsInterface::getButtons

File

src/Plugin/CKEditorPlugin/AbbreviationCKEditorButton.php, line 29

Class

AbbreviationCKEditorButton
Defines the "abbr" plugin.

Namespace

Drupal\ckeditor_abbreviation\Plugin\CKEditorPlugin

Code

public function getButtons() {

  // Make sure that the path to the image matches the file structure of
  // the CKEditor plugin you are implementing.
  $path = drupal_get_path('module', 'ckeditor_abbreviation') . '/js/plugins/abbr';
  return [
    'abbr' => [
      'label' => $this
        ->t('Abbreviation ckeditor button'),
      'image' => $path . '/icons/abbr.png',
    ],
  ];
}