Same name and namespace in other branches
  1. 5.x includes/common.inc \drupal_render()
  2. 6.x includes/common.inc \drupal_render()
  3. 7.x includes/common.inc \drupal_render()

Renders HTML given a structured array tree.

Deprecated

in drupal:8.0.0 and is removed from drupal:9.0.0. Use the 'renderer' service instead.

See also

\Drupal\Core\Render\RendererInterface::render()

https://www.drupal.org/node/2912696

File

core/includes/common.inc, line 811
Common functions that many Drupal modules will need to reference.

Code

function drupal_render(&$elements, $is_recursive_call = FALSE) {
  return \Drupal::service('renderer')
    ->render($elements, $is_recursive_call);
}