- //Create ApplicationType form
- $form = $this->createForm('Rapsys\AirBundle\Form\SnippetType', null, [
- //Set the action
- 'action' => $this->generateUrl('rapsys_air_snippet_add'),
- //Set the form attribute
- 'attr' => []
- ]);
+ //Create SnippetType form
+ $form = $this->container->get('form.factory')->createNamed(
+ //Set name
+ 'snipped_'.$request->getLocale().'_'.$request->get('location'),
+ //Set type
+ 'Rapsys\AirBundle\Form\SnippetType',
+ //Set data
+ null,
+ //Set options
+ [
+ //Set the action
+ 'action' => $this->generateUrl('rapsys_air_snippet_add', ['location' => $request->get('location')]),
+ //Set the form attribute
+ 'attr' => []
+ ]
+ );