You are here

public function FormElementLabel::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 PreprocessBase::preprocessElement

File

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

Class

FormElementLabel
Pre-processes variables for the "form_element_label" theme hook.

Namespace

Drupal\bootstrap\Plugin\Preprocess

Code

public function preprocessElement(Element $element, Variables $variables) {

  // Map the element properties.
  $variables
    ->map([
    'attributes',
    'is_checkbox',
    'is_radio',
  ]);

  // Preprocess attributes.
  $this
    ->preprocessAttributes();
}