You are here

protected function OrderForm::fieldAsReadOnly in Commerce Core 8.2

Builds a read-only form element for a field.

Parameters

string $label: The element label.

string $value: The element value.

Return value

array The form element.

1 call to OrderForm::fieldAsReadOnly()
OrderForm::form in modules/order/src/Form/OrderForm.php
Gets the actual form array to be built.

File

modules/order/src/Form/OrderForm.php, line 155

Class

OrderForm
Form controller for the commerce_order entity edit forms.

Namespace

Drupal\commerce_order\Form

Code

protected function fieldAsReadOnly($label, $value) {
  return [
    '#type' => 'item',
    '#wrapper_attributes' => [
      'class' => [
        'container-inline',
      ],
    ],
    '#title' => $label,
    '#markup' => $value,
  ];
}