protected function YamlFormSubmissionForm::setFormPropertiesFromElements in YAML Form 8
Set the form properties from the elements.
Parameters
array $form: An associative array containing the structure of the form.
array $elements: An associative array containing the elements.
1 call to YamlFormSubmissionForm::setFormPropertiesFromElements()
- YamlFormSubmissionForm::form in src/
YamlFormSubmissionForm.php - Gets the actual form array to be built.
File
- src/
YamlFormSubmissionForm.php, line 858
Class
- YamlFormSubmissionForm
- Provides a form to collect and edit submissions.
Namespace
Drupal\yamlformCode
protected function setFormPropertiesFromElements(array &$form, array &$elements) {
foreach ($elements as $key => $value) {
if (is_string($key) && $key[0] == '#') {
if (isset($form[$key]) && is_array($form[$key]) && is_array($value)) {
$form[$key] = NestedArray::mergeDeep($form[$key], $value);
}
else {
$form[$key] = $value;
}
unset($elements[$key]);
}
}
}