Skip to content

Commit cc55aa3

Browse files
committed
PHP5.3 syntax for arrays
1 parent 08581ef commit cc55aa3

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

cookbook/form/dynamic_form_generation.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -263,17 +263,17 @@ our listener::
263263
$form = $event->getForm();
264264
$userId = $user->getId();
265265

266-
$form_options = [
266+
$formOptions = array(
267267
'class' => 'Acme\DemoBundle\Document\User',
268268
'multiple' => false,
269269
'expanded' => false,
270270
'property' => 'fullName',
271271
'query_builder' => function(DocumentRepository $dr) use ($userId) {
272272
return $dr->createQueryBuilder()->field('friends.$id')->equals(new \MongoId($userId));
273-
}
274-
];
273+
},
274+
);
275275

276-
$form->add($factory->createNamed('friend', 'document', null, $form_options));
276+
$form->add($factory->createNamed('friend', 'document', null, $formOptions));
277277
}
278278
);
279279
}
@@ -396,11 +396,11 @@ call to ``$form->bind($request)``.
396396

397397
On a form, we can usually listen to the following events::
398398

399-
PRE_SET_DATA
400-
POST_SET_DATA
401-
PRE_BIND
402-
BIND
403-
POST_BIND
399+
* ``PRE_SET_DATA``
400+
* ``POST_SET_DATA``
401+
* ``PRE_BIND``
402+
* ``BIND``
403+
* ``POST_BIND``
404404

405405
When listening to bind and post-bind, it's already "too late" to make changes to
406406
the form. But pre-bind is fine. There is however a big difference in what

0 commit comments

Comments
 (0)