public static function WebformFormHelper::flattenElements in Webform 6.x
Same name and namespace in other branches
- 8.5 src/Utility/WebformFormHelper.php \Drupal\webform\Utility\WebformFormHelper::flattenElements()
Traverse a render array and collect references to all elements in an associative array keyed by element key.
Parameters
array $build: An render array.
Return value
array An associative array of elements by reference.
9 calls to WebformFormHelper::flattenElements()
- WebformDevelEntityFormApiExportForm::setDefaultValues in modules/
webform_devel/ src/ Form/ WebformDevelEntityFormApiExportForm.php - Set webform elements default values using test data.
- WebformDevelEntityFormApiTestForm::setDefaultValues in modules/
webform_devel/ src/ Form/ WebformDevelEntityFormApiTestForm.php - Set webform elements default values using test data.
- WebformFormHelperTest::testFlattenElements in tests/
src/ Unit/ Utility/ WebformFormHelperTest.php - Tests WebformFormHelper::flattenElements().
- WebformTokenManager::elementValidate in src/
WebformTokenManager.php - Validate form that should have tokens in it.
- webform_update_8151 in includes/
webform.install.update.inc - Issue #3013767: Computed twig element is not working on multi-step form.
File
- src/
Utility/ WebformFormHelper.php, line 197
Class
- WebformFormHelper
- Helper class webform based methods.
Namespace
Drupal\webform\UtilityCode
public static function &flattenElements(array &$build) {
$elements = [];
$duplicate_element_keys = [];
self::flattenElementsRecursive($build, $elements, $duplicate_element_keys);
return $elements;
}