title: How to use data from Zend_Db_Table in a Zend_Form
body: <p>I have create a form class for editing deleting and add users to a database. If I want to edit a user how can I simply supply the information of the user to the form.</p>
  
  <p>I use a Zend_Db_Table to get the data from the database.</p>
  
  <p>This is the userForm class:</p>
  
  <pre><code>class UsersForm extends Zend_Form
  {
      public function init ()
      {
          $username = new Zend_Form_Element_Text('username',array(
              'validatrors' =&gt; array(
                  'alpha',
                  array('stringLength',5,10)
                  ),
              'filters'   =&gt; array(
                  'StringToLower'
                  ),
              'required'  =&gt; true,
              'label'     =&gt; 'Gebruikersnaam:'
              ));
  
          $password = new Zend_Form_Element_Password('password', array(
              'validators'=&gt; array(
                  'Alnum',
                  array('StringLength', array(6,20))
                  ),
              'filters'   =&gt; array('StringTrim'),
              'required'  =&gt; true,
              'label'     =&gt; 'Wachtwoord:'
              ));
  
          $actif = new Zend_Form_Element_Checkbox('actif', array(
              'label'     =&gt; 'actif'));
  
          $this-&gt;addElements(array($username,$password,$actif));
  
          $this-&gt;setDecorators(array(
              'FormElements',
              array('HtmlTag', array('tag' =&gt; 'dl', 'class' =&gt; 'zend_form')),
              array('Description',array('placement' =&gt; 'prepand')),
              'Form'
          ));
      }
  }
  </code></pre>
  
  <p>Thank you,</p>
  
  <p>Ivo Trompert</p>