4 * Contains \Drupal\bootstrap\Plugin\Preprocess\FieldMultipleValueForm.
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 "field_multiple_value_form" theme hook.
16 * @ingroup plugins_preprocess
18 * @BootstrapPreprocess("field_multiple_value_form")
20 class FieldMultipleValueForm extends PreprocessBase implements PreprocessInterface {
25 public function preprocessElement(Element $element, Variables $variables) {
26 // Wrap header columns in label element for Bootstrap.
27 if ($variables['multiple']) {
31 '#prefix' => '<label class="label">',
32 'title' => ['#markup' => $element->getProperty('title')],
33 '#suffix' => '</label>',
38 !empty($element['#required']) ? 'form-required' : '',
41 t('Order', [], ['context' => 'Sort order']),
44 $variables['table']['#header'] = $header;