Skip to content

Instantly share code, notes, and snippets.

@redleafar
Created November 20, 2016 02:04
Show Gist options
  • Save redleafar/ff370e45ddd84885893b97595b2d7c84 to your computer and use it in GitHub Desktop.
Save redleafar/ff370e45ddd84885893b97595b2d7c84 to your computer and use it in GitHub Desktop.
Set the name of a form

Use createNamedBuilder, for instance:

$formplace = $this->get('form.factory')->createNamedBuilder('locationform', 'form', $place, array())
    	->setAction($this->generateUrl('booster_bici_reg_clubes'))
    	->setMethod('GET')
    	->add('place', 'auto_place', array('label' => 'Filtrar por ubicación'))
    	->add('submit','submit',array('label' => 'Buscar'))
    	->getForm();

Here the name is locationform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment