7 common.inc drupal_render_children(&$element, $children_keys = NULL)
8 common.inc drupal_render_children(&$element, $children_keys = NULL)

Renders children of an element and concatenates them.


array $element: The structured array whose children shall be rendered.

array $children_keys: (optional) If the keys of the element's children are already known, they can be passed in to save another run of \Drupal\Core\Render\Element::children().

Return value

string|\Drupal\Component\Utility\SafeStringInterface The rendered HTML of all children of the element.

See also


3 calls to drupal_render_children()
theme_system_modules_uninstall in core/modules/system/system.admin.inc
Returns HTML for a table of currently disabled modules.
Toolbar::preRenderToolbar in core/modules/toolbar/src/Element/Toolbar.php
Builds the Toolbar as a structured array ready for drupal_render().
views_pre_render_views_form_views_form in core/modules/views/views.module
Replaces views substitution placeholders.


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


function drupal_render_children(&$element, $children_keys = NULL) {
  if ($children_keys === NULL) {
    $children_keys = Element::children($element);
  $output = '';
  foreach ($children_keys as $key) {
    if (!empty($element [$key])) {
      $output .= drupal_render($element [$key]);
  return SafeString::create($output);