Forms

Forms

class Forms

Entry point of the Form component.

Use this class to conveniently create new form factories:

use Symfony\Component\Form\Forms;

$formFactory = Forms::createFormFactory();

$form = $formFactory->createBuilder() ->add('firstName', 'text') ->add('lastName', 'text') ->add('age', 'integer') ->add('gender', 'choice', array( 'choices' => array('m' => 'Male', 'f' => 'Female'), )) ->getForm();

You can also add custom extensions to the form factory:

$formFactory = Forms::createFormFactoryBuilder() ->addExtension(new AcmeExtension()) ->getFormFactory();

If you create custom form types or type extensions, it is generally recommended to create your own extensions that lazily load these types and type extensions. In projects where performance does not matter that much, you can also pass