public function Select::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/ Select.php, line 25 - Contains \Drupal\bootstrap\Plugin\Preprocess\Input.
Class
- Select
- Pre-processes variables for the "select" theme hook.
Namespace
Drupal\bootstrap\Plugin\PreprocessCode
public function preprocessElement(Element $element, Variables $variables) {
// Create variables for #input_group and #input_group_button flags.
$variables['input_group'] = $element
->getProperty('input_group') || $element
->getProperty('input_group_button');
// Map the element properties.
$variables
->map([
'attributes' => 'attributes',
'field_prefix' => 'prefix',
'field_suffix' => 'suffix',
]);
// Ensure attributes are proper objects.
$this
->preprocessAttributes();
}