1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| namespace Mc\UserBundle\Form\Type;
use Symfony\Component\Form\FormBuilderInterface;
use FOS\UserBundle\Form\Type\RegistrationFormType as BaseType;
class RegistrationFormType extends BaseType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
// on ajoute la selection des roles dans le formulaire de creation de d'un compte
parent::buildForm($builder, $options);
$builder->add('roles', 'choice', array(
'choices' => array(
'ROLE_ADMIN' => 'Admin',
'ROLE_SCIENTIFIC' => 'Scientific'
),
'multiple' => true,
)
);
}
public function getName()
{
return 'mc_user_registration';
}
} |
Partager