You are here

public static function WebformElementHelper::isElement in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/Utility/WebformElementHelper.php \Drupal\webform\Utility\WebformElementHelper::isElement()

Determine if an element and its key is a renderable array.

Parameters

array|mixed $element: An element.

string $key: The element key.

Return value

bool TRUE if an element and its key is a renderable array.

20 calls to WebformElementHelper::isElement()
Webform::collectSubElementKeysRecursive in src/Entity/Webform.php
Collect sub element keys from a render array.
Webform::deleteElementRecursive in src/Entity/Webform.php
Remove an element by key from a render array.
Webform::initElementsRecursive in src/Entity/Webform.php
Initialize webform elements into a flatten array.
Webform::initElementsTranslationsRecursive in src/Entity/Webform.php
Init elements translations before variants are applied.
Webform::setElementPropertiesRecursive in src/Entity/Webform.php
Set element properties.

... See full list

File

src/Utility/WebformElementHelper.php, line 98

Class

WebformElementHelper
Helper class webform element methods.

Namespace

Drupal\webform\Utility

Code

public static function isElement($element, $key) {
  return Element::child($key) && is_array($element);
}