private function LayoutBuilderIntegration::buildEntityView in Drupal 10
@todo Replace this hardcoded processing when https://www.drupal.org/project/drupal/issues/3041635 is resolved.
See also
\Drupal\Tests\EntityViewTrait::buildEntityView()
File
- core/
modules/ quickedit/ src/ LayoutBuilderIntegration.php, line 275
Class
- LayoutBuilderIntegration
- Helper methods for Layout Builder module integration.
Namespace
Drupal\quickeditCode
private function buildEntityView(array &$elements) {
// If the default values for this element have not been loaded yet,
// populate them.
if (isset($elements['#type']) && empty($elements['#defaults_loaded'])) {
$elements += \Drupal::service('element_info')
->getInfo($elements['#type']);
}
// Make any final changes to the element before it is rendered. This means
// that the $element or the children can be altered or corrected before
// the element is rendered into the final text.
if (isset($elements['#pre_render'])) {
foreach ($elements['#pre_render'] as $callable) {
$elements = call_user_func($callable, $elements);
}
}
// And recurse.
$children = Element::children($elements, TRUE);
foreach ($children as $key) {
$this
->buildEntityView($elements[$key]);
}
}