Chris@0: getInfo($elements['#type']); Chris@0: } Chris@0: Chris@0: // Make any final changes to the element before it is rendered. This means Chris@0: // that the $element or the children can be altered or corrected before the Chris@0: // element is rendered into the final text. Chris@0: if (isset($elements['#pre_render'])) { Chris@0: foreach ($elements['#pre_render'] as $callable) { Chris@0: $elements = call_user_func($callable, $elements); Chris@0: } Chris@0: } Chris@0: Chris@0: // And recurse. Chris@0: $children = Element::children($elements, TRUE); Chris@0: foreach ($children as $key) { Chris@0: $ensure_fully_built($elements[$key]); Chris@0: } Chris@0: }; Chris@0: Chris@0: $render_controller = $this->container->get('entity.manager')->getViewBuilder($entity->getEntityTypeId()); Chris@0: if ($reset) { Chris@0: $render_controller->resetCache([$entity->id()]); Chris@0: } Chris@0: $build = $render_controller->view($entity, $view_mode, $langcode); Chris@0: $ensure_fully_built($build); Chris@0: Chris@0: return $build; Chris@0: } Chris@0: Chris@0: }