Symfony2 exception when trying to embed a collection of forms
问题 A continuation of this question: I'm trying to embed a collection of forms as described in the official docs here. Unfortunately, I'm getting the following exception: The form's view data is expected to be an instance of class Acme\SiteBundle\Entity\BlogPost, but is a(n) array. You can avoid this error by setting the "data_class" option to null or by adding a view transformer that transforms a(n) array to an instance of Acme\SiteBundle\Entity\BlogPost. Which is odd, as I believe I followed