class RegisterType extends AbstractType
{
public function getName()
{
return '';
}
}
$form = $this->get('form.factory')->createNamed('', new RegisterType(), $user);
$form = $this->createForm(new RegisterType(), $user);
$form = $this->get('form.factory')->createNamedBuilder('', 'form', $defaultData)
->add('name', 'text')
->add('email', 'email')
->getForm();