This is a very simplified version of the function I am having issues with:
function example(&$form) {
$name = $form->getName();
foreach ($form as $sub) {
if ($sub instanceof Form) {
example($sub);
}
// need this to be the first entry of $name
echo $name;
}
}
example($this->form);
I need a way to keep the value of the first entry of $name
try adding another param to the function