function drupal_render_root in Drupal 8
Renders final HTML given a structured array tree.
Deprecated
in drupal:8.0.0 and is removed from drupal:9.0.0. Use \Drupal\Core\Render\RendererInterface::renderRoot() instead.
See also
\Drupal\Core\Render\RendererInterface::renderRoot()
https://www.drupal.org/node/2912696
1 call to drupal_render_root()
- RenderTest::testRenderRootDeprecation in core/
tests/ Drupal/ KernelTests/ Core/ Render/ RenderTest.php - Tests the drupal_render_root() deprecation.
File
- core/
includes/ common.inc, line 797 - Common functions that many Drupal modules will need to reference.
Code
function drupal_render_root(&$elements) {
@trigger_error('drupal_render_root() is deprecated in drupal:8.0.0 and is removed from drupal:9.0.0. Use \\Drupal\\Core\\Render\\RendererInterface::renderRoot() instead. See https://www.drupal.org/node/2912696', E_USER_DEPRECATED);
return \Drupal::service('renderer')
->renderRoot($elements);
}