You are here

public static function WebformElementHelper::isAccessibleElement in Webform 6.x

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

Determine if an element is accessible.

Parameters

array|mixed $element: An element.

Return value

bool TRUE if an element is accessible.

See also

\Drupal\Core\Render\Element::isVisibleElement

2 calls to WebformElementHelper::isAccessibleElement()
WebformSubmissionConditionsValidator::getBuildElementsRecursive in src/WebformSubmissionConditionsValidator.php
Recurse through a form, review #states/#required, and get visible elements.
WebformSubmissionConditionsValidator::validateFormRecursive in src/WebformSubmissionConditionsValidator.php
Recurse through a form and validate visible elements.

File

src/Utility/WebformElementHelper.php, line 113

Class

WebformElementHelper
Helper class webform element methods.

Namespace

Drupal\webform\Utility

Code

public static function isAccessibleElement($element) {
  return isset($element['#access']) && $element['#access'] === FALSE ? FALSE : TRUE;
}