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().
string|\Drupal\Component\Render\MarkupInterface The rendered HTML of all children of the element.
in Drupal 8.0.x and will be removed before 9.0.0. Avoid early rendering when possible or loop through the elements and render them as they are available.
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 Markup::create($output); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!includes!common.inc/function/drupal_render_children/8.1.x