You are here

public static function Element::properties in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Render/Element.php \Drupal\Core\Render\Element::properties()
  2. 9 core/lib/Drupal/Core/Render/Element.php \Drupal\Core\Render\Element::properties()

Gets properties of a structured array element (keys beginning with '#').

Parameters

array $element: An element array to return properties for.

Return value

array An array of property keys for the element.

3 calls to Element::properties()
ElementTest::testProperties in core/tests/Drupal/Tests/Core/Render/ElementTest.php
Tests the properties() method.
RendererTest::testRenderCacheProperties in core/tests/Drupal/Tests/Core/Render/RendererTest.php
Tests that #cache_properties are properly handled.
TextFormat::processFormat in core/modules/filter/src/Element/TextFormat.php
Expands an element into a base element with text format selector attached.

File

core/lib/Drupal/Core/Render/Element.php, line 39

Class

Element
Provides helper methods for Drupal render elements.

Namespace

Drupal\Core\Render

Code

public static function properties(array $element) {
  return array_filter(array_keys($element), [
    static::class,
    'property',
  ]);
}