public function buildForm($builder, $options) { $builder ->add('_username', 'text') ->add('_password', 'password') ->add('_remember_me', 'checkbox') ->add('submit', 'submit'); // new! } public function setDefaultOptions($resolver) { $resolver->setDefaults(array( 'csrf_field_name' => '_csrf_token', 'intention' => 'authenticate', )); } public function getName() { return 'login'; } }