2

I want to override the edit user form in FOSUserbundle to hide some fields, I created my type extending AbstractType, I know how to add fields but not how to hide existing ones like username and/or password. Actually I can hide the username doing

$builder->remove('username');

how can I hide the password? doing $builder->remove('password'); or $builder->remove('current_password'); doesn't work

thanks

user3174311
  • 1,714
  • 5
  • 28
  • 66
  • Some hints: http://stackoverflow.com/questions/8832916/remove-replace-the-username-field-with-email-using-fosuserbundle-in-symfony2?rq=1 – Veve Jul 20 '16 at 09:12
  • yeah I know that but how can I hide the password field? – user3174311 Jul 20 '16 at 09:20
  • @user3174311, your issue is quite basic and solution should be simple too :) if you really think you should extend your form take a look into http://symfony.com/doc/current/cookbook/form/create_form_type_extension.html, but i dont think its necessary. meanwhile I will delete my answer and vote your question up so it would get more attention – pavlovich Jul 20 '16 at 10:39
  • @user3174311 p.s. once again I propose you to rely on form customization recipe from symfony cookbook http://symfony.com/doc/current/cookbook/form/form_customization.html – pavlovich Jul 20 '16 at 10:41

0 Answers0