1 common.inc backdrop_render_children(&$element, $children_keys = NULL)

Renders children of an element and concatenates them.

Parameters

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 element_children().

Return value

string: The rendered HTML of all children of the element.

See also

backdrop_render()

File

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

Code

function backdrop_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 .= backdrop_render($element[$key]);
    }
  }
  return $output;
}