I'm using a form which contains wrapped elements. The wrapping happens in the view like described here.
My action looks like this:
$myForm = [definition here]
$myForm->setName('entity');
$myForm->setWrapElements(true);
$request = $this->getRequest();
if ($request->isPost()) {
$myEntity = new Entity();
$myForm->bind($myEntity);
$myForm->setData($request->getPost()->get('entity'));
The problem: When calling $myForm->isValid() it's invalid. When calling $myForm->getData() afterwards it's empty.
I repeated the setName and setWrapElements in the action but with or without it, it doesn't work.
Any ideas what I might be doing wrong? The form definition is untouched and works for non-wrapped forms. So I guess the error is not in there.
P.S.: An echo of $myForm->isValid() returns an empty string. Is there maybe a way to get the error message? The form fields are filled with the data I've put in there and don't show any errors.