title: Neither the property "password" nor one of the methods exists in twig/symfony
body: <p>I want to make reuse of the form field by passing <code>show_password_field</code> as true  in the optional value in <code>AddUserType.php</code>. My edit form field should not contain password field. So I have used this</p>
  
  <pre><code>if ($options['show_password_field']) {
        $builder-&gt;add('password','password',array('required'=&gt;true));
      }
  </code></pre>
  
  <p>in form type. Can anybody figure it out? What is the problem in line 37 of twig file.</p>
  
  <blockquote>
    <p>Neither the property "password" nor one of the methods "password()",
    "getpassword()"/"ispassword()" or "__call()" exist and have public
    access in class "Symfony\Component\Form\FormView" in
    SokosimuEditorBundle:User:addUser.html.twig at line 37.</p>
  </blockquote>
  
  <p><strong>AddUserType.php</strong></p>
  
  <pre><code>   namespace Sokosimu\EditorBundle\Form\Type;
  
     use Symfony\Component\Form\AbstractType;
     use Symfony\Component\Form\FormBuilderInterface;
     use Symfony\Component\Form\Extension\Core\Type\SubmitType;
     use Symfony\Component\OptionsResolver\OptionsResolverInterface;
  
    class AddUserType extends AbstractType
    {
  
   public function buildForm(FormBuilderInterface $builder, array $options)
   {
      $builder-&gt;add('alias','text',array('required'=&gt;false));
      $builder-&gt;add('email', 'email',array('required'=&gt;false));
  
      if ($options['show_password_field']) {
          $builder-&gt;add('password','password',array('required'=&gt;true));
      }
  
      $builder-&gt;add('mobile','text',array('required'=&gt;false));
      $builder-&gt;add('submit', 'submit');
  }
  
  public function setDefaultOptions(OptionsResolverInterface $resolver)
  {
      $resolver-&gt;setDefaults(array(
          'data_class' =&gt; 'Sokosimu\UserBundle\Entity\User',
          'show_password_field' =&gt; true
      ));
  }
  
  /**
   * Returns the name of this type.
   *
   * @return string The name of this type
   */
   public function getName()
   {
       return 'adduser';
    }
  }
  </code></pre>
  
  <p>And line 37 in addUser.html.twig </p>
  
  <pre><code>&lt;div class="form-group"&gt;
     &lt;label for="password"&gt;Password:&lt;/label&gt;
     {{ form_widget(form.password,{'attr':{'class':'form-row'}}) }}
     {{ form_errors(form.password) }}
    &lt;/div&gt;
  </code></pre>
  
  <p><strong>Controller that renders edit</strong></p>
  
  <pre><code>public function editEditorUserAction(User $user,Request $request){
  
      $form = $this-&gt;createForm(new AddUserType(),$user,array(
          'show_password_field' =&gt; false));
  
      $form-&gt;handleRequest($request);
      if($form -&gt;isValid() &amp;&amp; $form-&gt;isSubmitted()){
          $em = $this-&gt;get('doctrine')-&gt;getManager();
          $editUser = $user -&gt;getEditoruser();
  
          $em-&gt;persist($editUser);
          $em-&gt;flush();
  
          return $this-&gt;redirect($this-&gt;generateUrl('sokosimu_editor_userlist'));
      }
  
      return $this-&gt;render('SokosimuEditorBundle:User:addUser.html.twig', array(
          'form' =&gt; $form-&gt;createView(),
           'user' =&gt; $user-&gt;getId()
      ));
    }
  </code></pre>