protected function FormStep::getAllChildren in Simple multi step form 8
Same name and namespace in other branches
- 8.x src/FormStep.php \Drupal\simple_multistep\FormStep::getAllChildren()
Get all child from field group.
Parameters
object $fieldgroup: Field group object.
array $child: Array with existing child.
Return value
array Return array with child.
2 calls to FormStep::getAllChildren()
- FormStep::getStepValues in src/
FormStep.php - Get submission values for current step.
- MultistepController::rebuildForm in src/
MultistepController.php - Prepare Multistep Form.
File
- src/
FormStep.php, line 223
Class
- FormStep
- Class FormStep.
Namespace
Drupal\simple_multistepCode
protected function getAllChildren($fieldgroup, array $child = []) {
if ($group_children = $fieldgroup->children) {
foreach ($group_children as $form_element_id) {
if (isset($this->form[$form_element_id])) {
$child[] = $form_element_id;
}
elseif (isset($this->form['#fieldgroups'][$form_element_id]->children)) {
$child = $this
->getAllChildren($this->form['#fieldgroups'][$form_element_id], $child);
}
}
}
return $child;
}