FieldMultipleValueForm.php in Express 8
File
themes/contrib/bootstrap/src/Plugin/Preprocess/FieldMultipleValueForm.php
View source
<?php
namespace Drupal\bootstrap\Plugin\Preprocess;
use Drupal\bootstrap\Annotation\BootstrapPreprocess;
use Drupal\bootstrap\Utility\Element;
use Drupal\bootstrap\Utility\Variables;
class FieldMultipleValueForm extends PreprocessBase implements PreprocessInterface {
public function preprocessElement(Element $element, Variables $variables) {
if ($variables['multiple']) {
$header = [
[
'data' => [
'#prefix' => '<label class="label">',
'title' => [
'#markup' => $element
->getProperty('title'),
],
'#suffix' => '</label>',
],
'colspan' => 2,
'class' => [
'field-label',
!empty($element['#required']) ? 'form-required' : '',
],
],
t('Order', [], [
'context' => 'Sort order',
]),
];
$variables['table']['#header'] = $header;
}
}
}