public function WebformUiElementFormBase::exists in Webform 8.5
Same name and namespace in other branches
- 6.x modules/webform_ui/src/Form/WebformUiElementFormBase.php \Drupal\webform_ui\Form\WebformUiElementFormBase::exists()
Determines if the webform element key already exists.
Parameters
string $key: The webform element key.
Return value
bool TRUE if the webform element key, FALSE otherwise.
1 method overrides WebformUiElementFormBase::exists()
- WebformUiElementTestForm::exists in modules/
webform_ui/ src/ Form/ WebformUiElementTestForm.php - Determines if the webform element key already exists.
File
- modules/
webform_ui/ src/ Form/ WebformUiElementFormBase.php, line 613
Class
- WebformUiElementFormBase
- Provides a base class for webform element webforms.
Namespace
Drupal\webform_ui\FormCode
public function exists($key) {
$elements = $this->webform
->getElementsInitializedAndFlattened();
return isset($elements[$key]) ? TRUE : FALSE;
}