4 * Contains \Drupal\bootstrap\Plugin\Preprocess\Input.
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 "select" theme hook.
16 * @ingroup plugins_preprocess
18 * @BootstrapPreprocess("select")
20 class Select extends PreprocessBase implements PreprocessInterface {
25 public function preprocessElement(Element $element, Variables $variables) {
26 // Create variables for #input_group and #input_group_button flags.
27 $variables['input_group'] = $element->getProperty('input_group') || $element->getProperty('input_group_button');
29 // Map the element properties.
31 'attributes' => 'attributes',
32 'field_prefix' => 'prefix',
33 'field_suffix' => 'suffix',
36 // Ensure attributes are proper objects.
37 $this->preprocessAttributes();