function drupal_render

Same name and namespace in other branches
  1. 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

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.