You are here

public static function WebformElementHelper::isWebformElement in Webform 8.5

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

Determine if an element is a webform element and should be enhanced.

Parameters

array $element: An element.

Return value

bool TRUE if an element is a webform element.

12 calls to WebformElementHelper::isWebformElement()
webform_bootstrap_preprocess_form_element in modules/webform_bootstrap/webform_bootstrap.module
Implements hook_preprocess_form_element() for form element templates.
webform_preprocess_checkboxes in includes/webform.theme.inc
Implements hook_preprocess_checkboxes() for checkboxes templates.
webform_preprocess_datetime_form in includes/webform.theme.inc
Implements hook_preprocess_datetime_form() for datetime form element templates.
webform_preprocess_details in includes/webform.theme.inc
Implements hook_preprocess_details() for details element templates.
webform_preprocess_fieldset in includes/webform.theme.inc
Implements hook_preprocess_fieldset() for fieldset templates.

... See full list

File

src/Utility/WebformElementHelper.php, line 146

Class

WebformElementHelper
Helper class webform element methods.

Namespace

Drupal\webform\Utility

Code

public static function isWebformElement(array $element) {
  if (isset($element['#webform_key']) || isset($element['#webform_element'])) {
    return TRUE;
  }
  elseif (\Drupal::service('webform.request')
    ->isWebformAdminRoute()) {
    return TRUE;
  }
  else {
    return FALSE;
  }
}