1 common.inc render(&$element)

Renders an element.

This function renders an element using backdrop_render(). The top level element is shown with show() before rendering, so it will always be rendered even if hide() had been previously used on it.

Parameters

$element: The element to be rendered.

Return value

The rendered element.:

See also

backdrop_render()

show()

hide()

File

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

Code

function render(&$element) {
  if (is_array($element)) {
    show($element);
    return backdrop_render($element);
  }
  else {
    // Safe-guard for inappropriate use of render() on flat variables: return
    // the variable as-is.
    return $element;
  }
}