Here is written how to set the name of a form with a class:
http://symfony.com/doc/2.0/book/forms.html#creating-form-classes
but how to set the name of this
There is no shortcut method for this purpose. Instead you have to access the method createNamedBuilder in the form factory:
createNamedBuilder
$this->get('form.factory')->createNamedBuilder('form', 'form_name', $defaultData) ->add('name', 'text') ->add('email', 'email') ->getForm();