4 * Contains \Drupal\bootstrap\Plugin\Preprocess\InputButton.
7 namespace Drupal\bootstrap\Plugin\Preprocess;
9 use Drupal\bootstrap\Annotation\BootstrapPreprocess;
10 use Drupal\bootstrap\Utility\Element;
11 use Drupal\bootstrap\Utility\Variables;
14 * Pre-processes variables for the "input__button" theme hook.
16 * @ingroup plugins_preprocess
18 * @BootstrapPreprocess("input__button")
20 class InputButton extends Input implements PreprocessInterface {
25 public function preprocessElement(Element $element, Variables $variables) {
27 $element->setButtonSize();
28 $element->setIcon($element->getProperty('icon'));
29 $variables['icon_only'] = $element->getProperty('icon_only');
30 $variables['icon_position'] = $element->getProperty('icon_position');
31 $variables['label'] = $element->getProperty('value');
32 if ($element->getProperty('split')) {
33 $variables->map([$variables::SPLIT_BUTTON]);
35 parent::preprocessElement($element, $variables);