function Details::preRenderDetails

Same name in this branch
  1. 11.x core/lib/Drupal/Core/Render/Element/Details.php \Drupal\Core\Render\Element\Details::preRenderDetails()
Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Render/Element/Details.php \Drupal\Core\Render\Element\Details::preRenderDetails()
  2. 8.9.x core/lib/Drupal/Core/Render/Element/Details.php \Drupal\Core\Render\Element\Details::preRenderDetails()
  3. 10 core/lib/Drupal/Core/Render/Element/Details.php \Drupal\Core\Render\Element\Details::preRenderDetails()

Adds form element theming to details.

Parameters

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

Return value

array The modified element.

File

core/modules/system/tests/modules/element_info_test/src/Render/Element/Details.php, line 51

Class

Details
Provides a render element for a details element.

Namespace

Drupal\element_info_test\Render\Element

Code

public static function preRenderDetails($element) : array {
  Element::setAttributes($element, [
    'custom',
  ]);
  return $element;
}

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