File tree 1 file changed +15
-11
lines changed 1 file changed +15
-11
lines changed Original file line number Diff line number Diff line change @@ -82,18 +82,22 @@ but here's a short example::
82
82
use Symfony\Component\Validator\Constraints\Length;
83
83
use Symfony\Component\Validator\Constraints\NotBlank;
84
84
use Symfony\Component\Form\Extension\Core\Type\TextType;
85
+ use Symfony\Component\Form\FormBuilderInterface;
85
86
86
- $builder
87
- ->add('firstName', TextType::class, array(
88
- 'constraints' => new Length(array('min' => 3)),
89
- ))
90
- ->add('lastName', TextType::class, array(
91
- 'constraints' => array(
92
- new NotBlank(),
93
- new Length(array('min' => 3)),
94
- ),
95
- ))
96
- ;
87
+ public function buildForm(FormBuilderInterface $builder, array $options)
88
+ {
89
+ $builder
90
+ ->add('firstName', TextType::class, array(
91
+ 'constraints' => new Length(array('min' => 3)),
92
+ ))
93
+ ->add('lastName', TextType::class, array(
94
+ 'constraints' => array(
95
+ new NotBlank(),
96
+ new Length(array('min' => 3)),
97
+ ),
98
+ ))
99
+ ;
100
+ }
97
101
98
102
.. tip ::
99
103
You can’t perform that action at this time.
0 commit comments