3 namespace Drupal\bootstrap\Plugin\Preprocess;
5 use Drupal\bootstrap\Utility\Element;
6 use Drupal\bootstrap\Utility\Variables;
9 * Pre-processes variables for the "select" theme hook.
11 * @ingroup plugins_preprocess
13 * @BootstrapPreprocess("select")
15 class Select extends PreprocessBase implements PreprocessInterface {
20 public function preprocessElement(Element $element, Variables $variables) {
21 // Create variables for #input_group and #input_group_button flags.
22 $variables['input_group'] = $element->getProperty('input_group') || $element->getProperty('input_group_button');
24 // Map the element properties.
26 'attributes' => 'attributes',
27 'field_prefix' => 'prefix',
28 'field_suffix' => 'suffix',
31 // Ensure attributes are proper objects.
32 $this->preprocessAttributes();