As far as I know symfony 2 contains its own form builder. However I don't really know how to connect it with form classes...
To demonstrate what I mean let me write simple piece of code I used combined with standard HTML form:
public function proccessFormAction()
{
if(! $_POST)
{
return $this->render('::ViewWithForm.html.twig');
}
else // after clicking submit in the form above
{
// validation, and other operations
}
}
Creating separate form classes handling all of this would be great, but...and here comes the first question - where should I place these classes? Just throw them in into the bundle's controllers?
Also I've been thinking about displaying form from inside the processFormAction() method, and making all kind of operations on them in form class - is this a good idea?
By form class I mean this Task class from the tutorial.
UserType.php) that would tell the form builder how to represent that entity (in this case, a User) as form fields. Is that what you mean?/src/path/to/bundle/Form/Typedirectory. So, theFormdirectory would be at the same level asControllerandResourcesand would contain aTypesubdirectory