3 namespace Drupal\bootstrap\Plugin\Preprocess;
5 use Drupal\bootstrap\Utility\Element;
6 use Drupal\bootstrap\Utility\Variables;
9 * Pre-processes variables for the "field_multiple_value_form" theme hook.
11 * @ingroup plugins_preprocess
13 * @BootstrapPreprocess("field_multiple_value_form")
15 class FieldMultipleValueForm extends PreprocessBase implements PreprocessInterface {
20 public function preprocessElement(Element $element, Variables $variables) {
21 // Wrap header columns in label element for Bootstrap.
22 if ($variables['multiple']) {
26 '#prefix' => '<label class="label">',
27 'title' => ['#markup' => $element->getProperty('title')],
28 '#suffix' => '</label>',
33 !empty($element['#required']) ? 'form-required' : '',
36 t('Order', [], ['context' => 'Sort order']),
39 $variables['table']['#header'] = $header;