Skip to content

Instantly share code, notes, and snippets.

@midnai
Created November 19, 2014 23:56
Show Gist options
  • Save midnai/498ad62cbb7a7023545c to your computer and use it in GitHub Desktop.
Save midnai/498ad62cbb7a7023545c to your computer and use it in GitHub Desktop.
Symfony2 Form Login: Rename fields name atributte's
changing your firewall to match this:
security:
firewalls:
my_firewall:
pattern: ^/
form_login:
username_parameter: "form_name[username_field_name]"
password_parameter: "form_name[password_field_name]"
csrf_parameter: "form_name[_token]"
csrf_provider: form.csrf_provider
intention: authentication
in your form type:
$resolver->setDefaults(array(
'intention' => 'authentication'
));
public function getName()
{
return 'form_name';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment