file Select.php

Namespace

Drupal\bootstrap\Plugin\Preprocess
  1. <?php
  2. namespace Drupal\bootstrap\Plugin\Preprocess;
  3. use Drupal\bootstrap\Utility\Element;
  4. use Drupal\bootstrap\Utility\Variables;
  5. /**
  6. * Pre-processes variables for the "select" theme hook.
  7. *
  8. * @ingroup plugins_preprocess
  9. *
  10. * @BootstrapPreprocess("select")
  11. */
  12. class Select extends PreprocessBase implements PreprocessInterface {
  13. /**
  14. * {@inheritdoc}
  15. */
  16. public function preprocessElement(Element $element, Variables $variables) {
  17. // Create variables for #input_group and #input_group_button flags.
  18. $variables['input_group'] = $element->getProperty('input_group') || $element->getProperty('input_group_button');
  19. // Map the element properties.
  20. $variables->map([
  21. 'attributes' => 'attributes',
  22. 'field_prefix' => 'prefix',
  23. 'field_suffix' => 'suffix',
  24. ]);
  25. // Ensure attributes are proper objects.
  26. $this->preprocessAttributes();
  27. }
  28. }

Classes

Name Description
Select Pre-processes variables for the "select" theme hook.