title: Symfony - Neither the property "first_name" nor one of the methods exist and have public access in class "Symfony\Component\Form\FormView"
body: <p>I've been reading and finding a solution for this problem since hours now. But it seems that I can't really fix this error. I found out that only when I add the form in <strong>FOS/UserBundle/Form/Type/RegistrationFormType</strong> that's the only time where it shows in the twig. I think I'm having some problem calling for my <strong>UserBundle/Form/RegistrationFormType</strong>.
  Badly need help on this one.</p>
  
  <p>I'm using FOSUserBundle</p>
  
  <p>Here's my <strong>User</strong> class:</p>
  
  <pre><code>&lt;?php
  
  namespace UserBundle\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(name="first_name", type="string", length=255, nullable=false)
   * @Assert\NotBlank(message="Please enter your first name", groups={"Registration", "Profile"})
   */
  protected $firstName;
  
  /**
   * @ORM\Column(name="middle_name", type="string", length=255, nullable=false)
   * @Assert\NotBlank(message="Please enter your middle name", groups={"Registration", "Profile"})
   */
  protected $middleName;
  
  /**
   * @ORM\Column(name="last_name", type="string", length=255, nullable=false)
   * @Assert\NotBlank(message="Please enter your last name", groups={"Registration", "Profile"})
   */
  protected $lastName;
  
  /**
   * @ORM\Column(name="position", type="string", length=255, nullable=false)
   * @Assert\NotBlank(message="Please enter your position/title", groups={"Registration", "Profile"})
   */
  protected $position;
  
  /**
   * @ORM\Column(name="gender", type="string", length=255, nullable=false)
   * @Assert\NotBlank(message="Please chose your gender", groups={"Registration", "Profile"})
   */
  protected $gender;
  
  /**
   * @ORM\Column(name="birth_date", type="string", nullable=true)
   */
  protected $birthDate;
  
  /**
   * @ORM\Column(name="address", type="string", length=255, nullable=true)
   */
  protected $address;
  
  /**
   * @ORM\Column(name="school", type="string", length=255, nullable=true)
   */
  protected $school;
  
  /**
   * @ORM\Column(name="hired_date", type="string", nullable=false)
   */
  protected $hiredDate;
  
  /**
   * @ORM\Column(name="end_date", type="string", nullable=false)
   */
  protected $endDate;
  
  // Change the targetEntity path if you want to create the group
  
  /**
   * @ORM\ManyToMany(targetEntity="UserBundle\Entity\Group")
   * @ORM\JoinTable(name="fos_user_user_group",
   *      joinColumns={@ORM\JoinColumn(name="user_id", referencedColumnName="id")},
   *      inverseJoinColumns={@ORM\JoinColumn(name="group_id", referencedColumnName="id")}
   * )
   */
  protected $groups;
  
  public function __construct()
  {
      parent::__construct();
  
  }
  
  /**
   * @return String
   */
  public function getFirstName()
  {
      return $this-&gt;firstName;
  }
  
  /**
   * @return String
   */
  public function getMiddleName()
  {
      return $this-&gt;middleName;
  }
  
  /**
   * @return String
   */
  public function getLastName()
  {
      return $this-&gt;lastName;
  }
  
  /**
   * @return String
   */
  public function getPosition()
  {
      return $this-&gt;position;
  }
  
  /**
   * @return String
   */
  public function getGender()
  {
      return $this-&gt;gender;
  }
  
  /**
   * @return String
   */
  public function getBirthDate()
  {
      return $this-&gt;birthDate;
  }
  
  /**
   * @return String
   */
  public function getAddress()
  {
      return $this-&gt;address;
  }
  
  /**
   * @return String
   */
  public function getSchool()
  {
      return $this-&gt;school;
  }
  
  /**
   * @return String
   */
  public function getHiredDate()
  {
      return $this-&gt;hiredDate;
  }
  
  /**
   * @return String
   */
  public function getEndDate()
  {
      return $this-&gt;endDate;
  }
  
  /**
   * @param String $firstName
   * @return User
   */
  public function setFirstName($firstName)
  {
      $this-&gt;firstName = $firstName;
  
      return $this;
  }
  
  /**
   * @param String $middleName
   * @return User
   */
  public function setMiddleName($middleName)
  {
      $this-&gt;middleName = $middleName;
  
      return $this;
  }
  
  /**
   * @param String $lastName
   * @return User
   */
  public function setLastName($lastName)
  {
      $this-&gt;lastName = $lastName;
  
      return $this;
  }
  
  /**
   * @param String $position
   * @return User
   */
  public function setPosition($position)
  {
      $this-&gt;position = $position;
  
      return $this;
  }
  
  /**
   * @param String $gender
   * @return User
   */
  public function setGender($gender)
  {
      $this-&gt;gender = $gender;
  
      return $this;
  }
  
  /**
   * @param String $birthDate
   * @return User
   */
  public function setBirthDate($birthDate)
  {
      $this-&gt;birthDate = $birthDate;
  
      return $this;
  }
  
  /**
   * @param String $address
   * @return User
   */
  public function setAddress($address)
  {
      $this-&gt;address = $address;
  
      return $this;
  }
  
  /**
   * @param String $school
   * @return User
   */
  public function setSchool($school)
  {
      $this-&gt;school = $school;
  
      return $this;
  }
  
  /**
   * @param String $hiredDate
   * @return User
   */
  public function setHiredDate($hiredDate)
  {
      $this-&gt;hiredDate = $hiredDate;
  
      return $this;
  }
  
  /**
   * @param String $endDate
   * @return User
   */
  public function setEndDate($endDate)
  {
      $this-&gt;endDate = $endDate;
  
      return $this;
  }
  }
  </code></pre>
  
  <p>Here's My <strong>RegistrationFormType</strong>:</p>
  
  <pre><code>&lt;?php
  
  namespace UserBundle\Form;
  
  use Symfony\Component\Form\AbstractType;
  use Symfony\Component\Form\FormBuilderInterface;
  
  class RegistrationType extends AbstractType
  {
      public function buildForm(FormBuilderInterface $builder, array $options)
      {
          $builder
              -&gt;add('firstName', 'text', array('label' =&gt; 'form.first_name', 'translation_domain' =&gt; 'FOSUserBundle'))
              -&gt;add('middleName', 'text', array('label' =&gt; 'form.middle_name', 'translation_domain' =&gt; 'FOSUserBundle'))
              -&gt;add('lastName', 'text', array('label' =&gt; 'form.last_name', 'translation_domain' =&gt; 'FOSUserBundle'))
              -&gt;add('position', 'text', array('label' =&gt; 'form.position', 'translation_domain' =&gt; 'FOSUserBundle'))
              -&gt;add('gender', 'text', array('label' =&gt; 'form.gender', 'translation_domain' =&gt; 'FOSUserBundle'))
              -&gt;add('birthDate', 'date', array('label' =&gt; 'form.birth_Date', 'translation_domain' =&gt; 'FOSUserBundle'))
              -&gt;add('address', 'text', array('label' =&gt; 'form.address', 'translation_domain' =&gt; 'FOSUserBundle'))
              -&gt;add('school', 'text', array('label' =&gt; 'form.school', 'translation_domain' =&gt; 'FOSUserBundle'))
              -&gt;add('hiredDate', 'date', array('label' =&gt; 'form.hired_date', 'translation_domain' =&gt; 'FOSUserBundle'))
              -&gt;add('endDate', 'text', array('label' =&gt; 'form.end_date', 'translation_domain' =&gt; 'FOSUserBundle'))
          ;
      }
  
      public function getParent()
      {
          return 'fos_user_registration';
      }
  
      public function getName()
      {
          return 'user_registration';
      }
  }
  </code></pre>
  
  <p>Here's my <strong>services.yml</strong>:</p>
  
  <pre><code>services:
      app.form.registration:
          class: UserBundle\Form\RegistrationFormType
          tags:
              - { name: form.type, alias: user_registration }
  </code></pre>
  
  <p>Here's my <strong>config.yml</strong>:</p>
  
  <pre><code>fos_user:
  db_driver: orm
  firewall_name: main
  user_class: UserBundle\Entity\User
  group:
      group_class: UserBundle\Entity\Group
  profile:
      form:
          type: UserBundle\Form\ProfileFormType 
  registration:
      form:
          name: user_registration
  </code></pre>
  
  <p>Here's my <strong>twig</strong>: I wanna call all the other entities I made</p>
  
  <pre><code>{{ form_widget(form.first_name) }}
  {{ form_widget(form.last_name) }}
  {{ form_widget(form.middle_name) }}
  // and so on...
  </code></pre>