65db5d664d8e12c02c115cbc870385f841d48dfb
[yaffs-website] / web / themes / contrib / bootstrap / src / Plugin / Preprocess / Select.php
1 <?php
2
3 namespace Drupal\bootstrap\Plugin\Preprocess;
4
5 use Drupal\bootstrap\Utility\Element;
6 use Drupal\bootstrap\Utility\Variables;
7
8 /**
9  * Pre-processes variables for the "select" theme hook.
10  *
11  * @ingroup plugins_preprocess
12  *
13  * @BootstrapPreprocess("select")
14  */
15 class Select extends PreprocessBase implements PreprocessInterface {
16
17   /**
18    * {@inheritdoc}
19    */
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');
23
24     // Map the element properties.
25     $variables->map([
26       'attributes' => 'attributes',
27       'field_prefix' => 'prefix',
28       'field_suffix' => 'suffix',
29     ]);
30
31     // Ensure attributes are proper objects.
32     $this->preprocessAttributes();
33   }
34
35 }