title: FOSUserBundle overriding register form
body: <p>I would like to override the register form from FOSUserBundle.</p>
  
  <p>I have followed this page: <a href="https://github.com/FriendsOfSymfony/FOSUserBundle/blob/1.3.x/Resources/doc/overriding_forms.md" rel="nofollow">https://github.com/FriendsOfSymfony/FOSUserBundle/blob/1.3.x/Resources/doc/overriding_forms.md</a></p>
  
  <p>I want that the form to contain these six inputs:</p>
  
  <ol>
  <li>Salutation</li>
  <li>first name</li>
  <li>last name</li>
  <li>e-mail</li>
  <li>password</li>
  <li>password confirm</li>
  </ol>
  
  <p>My Folder Structure:</p>
  
  <p><a href="http://davis-design.de/folder_struct.png" rel="nofollow">enter link description here</a></p>
  
  <p>My User Class: </p>
  
  <pre><code>    &lt;?php
  
  namespace Bundles\FrontendBundle\Entity;
  
  use FOS\UserBundle\Entity\User as BaseUser;
  use Doctrine\ORM\Mapping as ORM;
  use Symfony\Component\Validator\Constraints as Assert;
  
  /**
   * @ORM\Entity
   * @ORM\Table(name="fos_user")
   */
  class User extends BaseUser
  {
      /**
       * @ORM\Id
       * @ORM\Column(type="integer")
       * @ORM\GeneratedValue(strategy="AUTO")
       */
      protected $id;
  
      /**
       * @ORM\Column(type="string", length=255)
       *
       * @Assert\NotBlank(message="Please enter your name.", groups={"Registration", "Profile"})
       * @Assert\MinLength(limit="3", message="The name is too short.", groups={"Registration", "Profile"})
       * @Assert\MaxLength(limit="255", message="The name is too long.", groups={"Registration", "Profile"})
       */
      //protected $name;
  
      public function __construct()
      {
          parent::__construct();
          // your own logic
      }
  
      /**
       * Get id
       *
       * @return integer 
       */
      public function getId()
      {
          return $this-&gt;id;
      }
  
  }
  </code></pre>
  
  <p>My service.yml Data:</p>
  
  <pre><code>parameters:
  services:
      frontendbundle.registration.form.type:
          class: Bundles\FrontendBundle\Form\Type\RegistrationFormType
          arguments: [%fos_user.model.user.class%]
          tags:
              - { name: form.type, alias: frontend_user_registration  }
      frontendbundle.form.handler.registration:
          class: Bundles\FrontendBundle\Form\Handler\RegistrationFormHandler
          arguments: ["@fos_user.registration.form", "@request", "@fos_user.user_manager", "@fos_user.mailer", "@fos_user.util.token_generator"]
          scope: request
          public: false
  </code></pre>
  
  <p>My config.yml Data:</p>
  
  <pre><code>fos_user:
  db_driver: orm # other valid values are 'mongodb', 'couchdb' and 'propel'
  firewall_name: main
  user_class: Bundles\FrontendBundle\Entity\User
  registration:
      form:
          type: frontend_user_registration
          handler: frontendbundle.form.handler.registration
  </code></pre>
  
  <p>My RegistrationFormType Class:</p>
  
  <pre><code>    &lt;?php
  
  namespace Bundles\FrontendBundle\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)
      {
          parent::buildForm($builder, $options);
  
          // add your custom field
          $builder-&gt;add('firstname')
              -&gt;add('lastname')
              -&gt;add('salutation')
              -&gt;add('email', 'email', array('label' =&gt; 'form.email', 'translation_domain' =&gt; 'FOSUserBundle'))
              -&gt;add('plainPassword', 'repeated', array(
                      'type' =&gt; 'password',
                      'options' =&gt; array('translation_domain' =&gt; 'FOSUserBundle'),
                      'first_options' =&gt; array('label' =&gt; 'form.password'),
                      'second_options' =&gt; array('label' =&gt; 'form.password_confirmation'),
                      'invalid_message' =&gt; 'fos_user.password.mismatch',
                  )
              )
          ;
      }
  
      public function setDefaultOptions(OptionsResolverInterface $resolver)
      {
          $resolver-&gt;setDefaults(array(
              'data_class' =&gt; "Bundles\FrontendBundle\Entity\User"
          ));
      }
  
      public function getName()
      {
          return 'frontend_user_registration';
      }
  }
  </code></pre>
  
  <p>How do I need to define the field here for my plan with the six inputs ?</p>
  
  <p>Hope someone can help me.</p>