function StylesCombo::getButtons

Same name in other branches
  1. 8.9.x core/modules/ckeditor/src/Plugin/CKEditorPlugin/StylesCombo.php \Drupal\ckeditor\Plugin\CKEditorPlugin\StylesCombo::getButtons()

Overrides CKEditorPluginButtonsInterface::getButtons

File

core/modules/ckeditor/src/Plugin/CKEditorPlugin/StylesCombo.php, line 52

Class

StylesCombo
Defines the "stylescombo" plugin.

Namespace

Drupal\ckeditor\Plugin\CKEditorPlugin

Code

public function getButtons() {
    return [
        'Styles' => [
            'label' => $this->t('Font style'),
            'image_alternative' => [
                '#type' => 'inline_template',
                '#template' => '<a href="#" role="button" aria-label="{{ styles_text }}"><span class="ckeditor-button-dropdown">{{ styles_text }}<span class="ckeditor-button-arrow"></span></span></a>',
                '#context' => [
                    'styles_text' => $this->t('Styles'),
                ],
            ],
        ],
    ];
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.