function render

8.x render(&$element)

Renders an element.

This function renders an element using drupal_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.


$element: The element to be rendered.

Return value

The rendered element.

See also




2 calls to render()
theme_file_widget_multiple in drupal/core/modules/file/
Returns HTML for a group of file upload widgets.
twig_render_var in drupal/core/themes/engines/twig/twig.engine
Wrapper around render() for twig printed output.
3 string references to 'render'
EntityManager::getRenderController in drupal/core/lib/Drupal/Core/Entity/EntityManager.php
Creates a new render controller instance.
hook_batch_alter in drupal/core/modules/system/system.api.php
Alter batch information before a batch is processed.
views_views_data in drupal/core/modules/views/
Implements hook_views_data().


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


function render(&$element) {
  if (!$element && $element !== 0) {
    return NULL;
  if (is_array($element)) {
    return drupal_render($element);
  else {
    // Safe-guard for inappropriate use of render() on flat variables: return
    // the variable as-is.
    return $element;