public function FieldLayoutEntityDisplayFormTrait::getRegions in Drupal 10
Same name and namespace in other branches
- 8 core/modules/field_layout/src/Form/FieldLayoutEntityDisplayFormTrait.php \Drupal\field_layout\Form\FieldLayoutEntityDisplayFormTrait::getRegions()
- 9 core/modules/field_layout/src/Form/FieldLayoutEntityDisplayFormTrait.php \Drupal\field_layout\Form\FieldLayoutEntityDisplayFormTrait::getRegions()
Overrides \Drupal\field_ui\Form\EntityDisplayFormBase::getRegions().
File
- core/
modules/ field_layout/ src/ Form/ FieldLayoutEntityDisplayFormTrait.php, line 29
Class
- FieldLayoutEntityDisplayFormTrait
- Provides shared code for entity display forms.
Namespace
Drupal\field_layout\FormCode
public function getRegions() {
$regions = [];
$layout_definition = $this->layoutPluginManager
->getDefinition($this
->getEntity()
->getLayoutId());
foreach ($layout_definition
->getRegions() as $name => $region) {
$regions[$name] = [
'title' => $region['label'],
'message' => $this
->t('No field is displayed.'),
];
}
$regions['hidden'] = [
'title' => $this
->t('Disabled', [], [
'context' => 'Plural',
]),
'message' => $this
->t('No field is hidden.'),
];
return $regions;
}