You are here

public function InputButton::preprocessElement in Express 8

Preprocess the variables array if an element is present.

Parameters

\Drupal\bootstrap\Utility\Element $element: The Element object.

\Drupal\bootstrap\Utility\Variables $variables: The Variables object.

Overrides Input::preprocessElement

File

themes/contrib/bootstrap/src/Plugin/Preprocess/InputButton.php, line 25
Contains \Drupal\bootstrap\Plugin\Preprocess\InputButton.

Class

InputButton
Pre-processes variables for the "input__button" theme hook.

Namespace

Drupal\bootstrap\Plugin\Preprocess

Code

public function preprocessElement(Element $element, Variables $variables) {
  $element
    ->colorize();
  $element
    ->setButtonSize();
  $element
    ->setIcon($element
    ->getProperty('icon'));
  $variables['icon_only'] = $element
    ->getProperty('icon_only');
  $variables['icon_position'] = $element
    ->getProperty('icon_position');
  $variables['label'] = $element
    ->getProperty('value');
  if ($element
    ->getProperty('split')) {
    $variables
      ->map([
      $variables::SPLIT_BUTTON,
    ]);
  }
  parent::preprocessElement($element, $variables);
}