You are here

protected function EntityViewDisplayEditForm::buildExtraFieldRow in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/field_ui/src/Form/EntityViewDisplayEditForm.php \Drupal\field_ui\Form\EntityViewDisplayEditForm::buildExtraFieldRow()

Builds the table row structure for a single extra field.

Parameters

string $field_id: The field ID.

array $extra_field: The pseudo-field element.

Return value

array A table row array.

Overrides EntityDisplayFormBase::buildExtraFieldRow

1 call to EntityViewDisplayEditForm::buildExtraFieldRow()
LayoutBuilderEntityViewDisplayForm::buildExtraFieldRow in core/modules/layout_builder/src/Form/LayoutBuilderEntityViewDisplayForm.php
Builds the table row structure for a single extra field.
1 method overrides EntityViewDisplayEditForm::buildExtraFieldRow()
LayoutBuilderEntityViewDisplayForm::buildExtraFieldRow in core/modules/layout_builder/src/Form/LayoutBuilderEntityViewDisplayForm.php
Builds the table row structure for a single extra field.

File

core/modules/field_ui/src/Form/EntityViewDisplayEditForm.php, line 72

Class

EntityViewDisplayEditForm
Edit form for the EntityViewDisplay entity type.

Namespace

Drupal\field_ui\Form

Code

protected function buildExtraFieldRow($field_id, $extra_field) {
  $extra_field_row = parent::buildExtraFieldRow($field_id, $extra_field);

  // Insert an empty placeholder for the label column.
  $label = [
    'empty_cell' => [
      '#markup' => ' ',
    ],
  ];
  $label_position = array_search('plugin', array_keys($extra_field_row));
  $extra_field_row = array_slice($extra_field_row, 0, $label_position, TRUE) + $label + array_slice($extra_field_row, $label_position, count($extra_field_row) - 1, TRUE);
  return $extra_field_row;
}