function VerticalTabs::preRenderVerticalTabs

Same name in other branches
  1. 9 core/lib/Drupal/Core/Render/Element/VerticalTabs.php \Drupal\Core\Render\Element\VerticalTabs::preRenderVerticalTabs()
  2. 8.9.x core/lib/Drupal/Core/Render/Element/VerticalTabs.php \Drupal\Core\Render\Element\VerticalTabs::preRenderVerticalTabs()
  3. 10 core/lib/Drupal/Core/Render/Element/VerticalTabs.php \Drupal\Core\Render\Element\VerticalTabs::preRenderVerticalTabs()

Prepares a vertical_tabs element for rendering.

Parameters

array $element: An associative array containing the properties and children of the vertical tabs element.

Return value

array The modified element.

File

core/lib/Drupal/Core/Render/Element/VerticalTabs.php, line 79

Class

VerticalTabs
Provides a render element for vertical tabs in a form.

Namespace

Drupal\Core\Render\Element

Code

public static function preRenderVerticalTabs($element) {
    // Do not render the vertical tabs element if it is empty.
    $group = implode('][', $element['#parents']);
    if (!Element::getVisibleChildren($element['group']['#groups'][$group])) {
        $element['#printed'] = TRUE;
    }
    return $element;
}

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