Skip to content

Commit 5b67852

Browse files
committed
removed the $factory variable which is no longer needed in 2.2
1 parent e203c40 commit 5b67852

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

cookbook/form/dynamic_form_modification.rst

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,9 @@ and fill in the listener logic::
270270
);
271271
}
272272

273-
$factory = $builder->getFormFactory();
274-
275273
$builder->addEventListener(
276274
FormEvents::PRE_SET_DATA,
277-
function(FormEvent $event) use($user, $factory){
275+
function(FormEvent $event) use ($user) {
278276
$form = $event->getForm();
279277

280278
$formOptions = array(
@@ -289,7 +287,7 @@ and fill in the listener logic::
289287

290288
// create the field, this is similar the $builder->add()
291289
// field name, field type, data, options
292-
$form->add($factory->createNamed('friend', 'entity', null, $formOptions));
290+
$form->add('friend', 'entity', $formOptions);
293291
}
294292
);
295293
}

0 commit comments

Comments
 (0)