function 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()

2 calls to show()
render in drupal/core/includes/common.inc
Renders an element.
twig_show in drupal/core/themes/engines/twig/twig.engine
Wrapper around show() that does not return the content.
4 string references to 'show'
Node::buildFilters in drupal/core/modules/node/lib/Drupal/node/Plugin/views/wizard/Node.php
Overrides Drupal\views\Plugin\views\wizard\WizardPluginBase::buildFilters().
TwigExtension::getTokenParsers in drupal/core/lib/Drupal/Core/Template/TwigExtension.php
ViewAddFormController::form in drupal/core/modules/views_ui/lib/Drupal/views_ui/ViewAddFormController.php
Overrides Drupal\Core\Entity\EntityFormController::form().
WizardPluginBase::buildFilters in drupal/core/modules/views/lib/Drupal/views/Plugin/views/wizard/WizardPluginBase.php
Builds the form structure for selecting the view's filters.

File

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

Code

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