webmozart / standalone-forms

139 stars 30 forks source link

GetName deprecated #14

Open felberj opened 8 years ago

felberj commented 8 years ago

This construct does not work anymore in Symfony 3+ (as you deprecated getName()):

https://github.com/webmozart/standalone-forms/blob/2.7%2Btwig/web/index.php#L12

old:

form = $formFactory->createBuilder()
    ->add('firstName', 'text', array(
        'constraints' => array(
            new NotBlank(),
            new Length(array('min' => 4)),
        ),
    ))

new:

form = $formFactory->createBuilder()
    ->add('firstName', TextType::class, array(
        'constraints' => array(
            new NotBlank(),
            new Length(array('min' => 4)),
        ),
    ))