You are here

FormElementLabel.php in Express 8

File

themes/contrib/bootstrap/src/Plugin/Preprocess/FormElementLabel.php
View source
<?php

/**
 * @file
 * Contains \Drupal\bootstrap\Plugin\Preprocess\FormElementLabel.
 */
namespace Drupal\bootstrap\Plugin\Preprocess;

use Drupal\bootstrap\Annotation\BootstrapPreprocess;
use Drupal\bootstrap\Utility\Element;
use Drupal\bootstrap\Utility\Variables;

/**
 * Pre-processes variables for the "form_element_label" theme hook.
 *
 * @ingroup plugins_preprocess
 *
 * @BootstrapPreprocess("form_element_label")
 */
class FormElementLabel extends PreprocessBase implements PreprocessInterface {

  /**
   * {@inheritdoc}
   */
  public function preprocessElement(Element $element, Variables $variables) {

    // Map the element properties.
    $variables
      ->map([
      'attributes',
      'is_checkbox',
      'is_radio',
    ]);

    // Preprocess attributes.
    $this
      ->preprocessAttributes();
  }

}

Classes

Namesort descending Description
FormElementLabel Pre-processes variables for the "form_element_label" theme hook.