I would like to bring some more precision. At least, for the most recent version of Symfony (2.1), the correct symtax (documented on the API) is:
<?php
public FormBuilderInterface createNamedBuilder(string $name, string|FormTypeInterface $type = 'form', mixed $data = null, array $options = array(), FormBuilderInterface $parent = null)
It is important because you can still pass options to the FormBuilder.
For a more concrete example:
<?php
$form = $this->get('form.factory')->createNamedBuilder('user', 'form', null, array(
'constraints' => $collectionConstraint,
))
->add('name', 'text')
->add('email', 'email')
->getForm();
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…