protected function SubscriptionForm::fieldAsReadOnly in Commerce Recurring Framework 8
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 SubscriptionForm::fieldAsReadOnly()
- SubscriptionForm::form in src/
Form/ SubscriptionForm.php - Gets the actual form array to be built.
File
- src/
Form/ SubscriptionForm.php, line 177
Class
Namespace
Drupal\commerce_recurring\FormCode
protected function fieldAsReadOnly($label, $value) {
return [
'#type' => 'item',
'#wrapper_attributes' => [
'class' => [
Html::cleanCssIdentifier(strtolower($label)),
'container-inline',
],
],
'#markup' => '<h4 class="label inline">' . $label . '</h4> ' . $value,
];
}