function Container::processContainer

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

Processes a container element.

Parameters

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

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

array $complete_form: The complete form structure.

Return value

array The processed element.

File

core/lib/Drupal/Core/Render/Element/Container.php, line 81

Class

Container
Provides a render element that wraps child elements in a container.

Namespace

Drupal\Core\Render\Element

Code

public static function processContainer(&$element, FormStateInterface $form_state, &$complete_form) {
    // Generate the ID of the element if it's not explicitly given.
    if (!isset($element['#id'])) {
        $element['#id'] = HtmlUtility::getUniqueId(implode('-', $element['#parents']) . '-wrapper');
    }
    return $element;
}

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