@@ -44,7 +44,7 @@ Now let's create a form to let the visitor fill the data of the object::
44
44
{
45
45
$customer = new Customer();
46
46
47
- $form = new Form('customer', $customer, $this->container->getValidatorService() );
47
+ $form = new Form('customer', $customer, $this['validator'] );
48
48
$form->add(new TextField('name'));
49
49
$form->add(new IntegerField('age'));
50
50
@@ -74,7 +74,7 @@ the data is stored in a POST parameter with the name of the form::
74
74
public function signupAction()
75
75
{
76
76
$customer = new Customer();
77
- $form = new Form('customer', $customer, $this->container->getValidatorService() );
77
+ $form = new Form('customer', $customer, $this['validator'] );
78
78
79
79
// form setup...
80
80
@@ -267,7 +267,7 @@ Now we can easily adapt the form in the controller::
267
267
$registration = new Registration();
268
268
$registration->customer = new Customer();
269
269
270
- $form = new Form('registration', $registration, $this->container->getValidatorService() );
270
+ $form = new Form('registration', $registration, $this['validator'] );
271
271
$form->add(new CheckboxField('termsAccepted'));
272
272
273
273
$group = new FieldGroup('customer');
0 commit comments