function Element::property

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

Checks if the key is a property.

Parameters

string $key: The key to check.

Return value

bool TRUE of the key is a property, FALSE otherwise.

1 call to Element::property()
ElementTest::testProperty in core/tests/Drupal/Tests/Core/Render/ElementTest.php
Tests the property() method.

File

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

Class

Element
Provides helper methods for Drupal render elements.

Namespace

Drupal\Core\Render

Code

public static function property($key) {
    return is_string($key) && $key[0] == '#';
}

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