3 namespace Mixstore\UserBundle\Form\Type
;
5 use Symfony\Component\Form\FormBuilderInterface
;
6 use FOS\UserBundle\Form\Type\ProfileFormType
as BaseType
;
7 use Symfony\Component\Security\Core\SecurityContext
;
9 class ProfileFormType
extends BaseType
11 public function buildForm(FormBuilderInterface
$builder, array $options)
13 parent
::buildForm($builder, $options);
15 // add your custom field
16 $builder->remove('username'); // we use email as the username
17 $builder->add('name'); // first name
18 $builder->add('surname'); // last name
20 //$user = $this->securityContext->getToken()->getUser();
21 // email notifications on packages/usecases creation
22 $builder->add('emailnotif0', 'checkbox', array('label' => 'Email notifications', 'required' => false));
24 $builder->add('emailnotif1', 'checkbox', array('label' => 'Also on updates', 'required' => false));
27 public function getName()
29 return 'mixstore_user_profile';