I’m trying to remove some fields from the form generated by sfDoctrineGuard.
I don’t care about the name or email of my users, I just want them to have an username and a password.

I’ve tried editing /lib/form/doctrine/sfDoctrineGuardPlugin/sfGuardUserForm.class.php :
class sfGuardUserForm extends PluginsfGuardUserForm
{
public function configure()
{
unset(
$this['first_name'],
$this['last_name'],
$this['email_adress']
);
}
}
But that did nothing. Am I editing the right file ?
EDIT The only way I can make those fields disappear is by editing the file in the /plugins/ directory !
plugins/sfDoctrineGuardPlugin/lib/form/doctrine/sfGuardUserAdminForm.class.php
Its probably using sfGuardUserAdminForm rather than sfGuardUserForm – check the view tab of the debug bar and it should tell you.
This class lives in the plugin, so you should subclass it under your project’s lib/form folder and copy your existing configure method to the subclass.
You can then tell it to use this form by editing gnerator.yml – again, copy it to your project/application’s modules folder from the plugin if you haven’t already. You need to change generator/param/config/form/class. You also need to remove the fields from the form/display key if they are there, or it’ll complain they don’t exist.