function show

Same name in other branches
  1. 9 core/includes/common.inc \show()
  2. 8.9.x core/includes/common.inc \show()
  3. 10 core/includes/common.inc \show()
  4. 11.x core/includes/common.inc \show()

Shows a hidden element for later rendering.

You can also use render($element), which shows the element while rendering it.

The first time render() or drupal_render() is called on an element tree, as each element in the tree is rendered, it is marked with a #printed flag and the rendered children of the element are cached. Subsequent calls to render() or drupal_render() will not traverse the child tree of this element again: they will just use the cached children. So if you want to show an element, be sure to call show() on the element before its parent tree is rendered for the first time, as it will have no effect on subsequent renderings of the parent tree.

Parameters

$element: The element to be shown.

Return value

The element.

See also

render()

hide()

1 call to show()
render in includes/common.inc
Renders an element.

File

includes/common.inc, line 6347

Code

function show(&$element) {
    $element['#printed'] = FALSE;
    return $element;
}

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