Version 1
[yaffs-website] / web / themes / contrib / bootstrap / src / Plugin / Preprocess / FormElementLabel.php
1 <?php
2 /**
3  * @file
4  * Contains \Drupal\bootstrap\Plugin\Preprocess\FormElementLabel.
5  */
6
7 namespace Drupal\bootstrap\Plugin\Preprocess;
8
9 use Drupal\bootstrap\Annotation\BootstrapPreprocess;
10 use Drupal\bootstrap\Utility\Element;
11 use Drupal\bootstrap\Utility\Variables;
12
13 /**
14  * Pre-processes variables for the "form_element_label" theme hook.
15  *
16  * @ingroup plugins_preprocess
17  *
18  * @BootstrapPreprocess("form_element_label")
19  */
20 class FormElementLabel extends PreprocessBase implements PreprocessInterface {
21
22   /**
23    * {@inheritdoc}
24    */
25   public function preprocessElement(Element $element, Variables $variables) {
26     // Map the element properties.
27     $variables->map(['attributes', 'is_checkbox', 'is_radio']);
28
29     // Preprocess attributes.
30     $this->preprocessAttributes();
31   }
32
33 }