File tree 1 file changed +8
-2
lines changed 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -407,6 +407,12 @@ The meetup is passed as an entity hidden field to the form. So we can access eac
407
407
sport like this::
408
408
409
409
// src/Acme/DemoBundle/Form/Type/SportMeetupType.php
410
+ namespace Acme\DemoBundle\Form\Type;
411
+
412
+ use Symfony\Component\Form\FormBuilderInterface;
413
+ use Symfony\Component\Form\FormEvents;
414
+ use Symfony\Component\Form\FormEvent;
415
+
410
416
class SportMeetupType extends AbstractType
411
417
{
412
418
public function buildForm(FormBuilderInterface $builder, array $options)
@@ -419,7 +425,7 @@ sport like this::
419
425
420
426
$builder->addEventListener(
421
427
FormEvents::PRE_SET_DATA,
422
- function(FormEvent $event) use($factory){
428
+ function(FormEvent $event) use ($factory){
423
429
$form = $event->getForm();
424
430
425
431
// this would be your entity, i.e. SportMeetup
@@ -528,7 +534,7 @@ The subscriber would now look like::
528
534
->find($id);
529
535
530
536
if ($meetup === null) {
531
- $msg = 'The event %s could not be found for you registration';
537
+ $msg = 'The event %s could not be found for your registration';
532
538
throw new \Exception(sprintf($msg, $id));
533
539
}
534
540
$form = $event->getForm();
You can’t perform that action at this time.
0 commit comments