79606528

Date: 2025-05-05 08:02:37
Score: 1
Natty:
Report link

Seems there is no method for this.

I needed to iterate over all form fields and get their data:

$data = array_map(fn ($v) => $v->getData(), $form->all());

If you have nested forms, then something along those lines (untested):

$data = array_map(function ($field) {
    if ($field->getConfig()->getCompound()) {
        $fieldsData = ... // call recursively
        return $fieldsData;
    }
    return $field->getData();
}, $form->all());
Reasons:
  • Blacklisted phrase (0.5): I need
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: JohnSmith