title: using setValue in Zend-Form
body: <p>I try to pass a value to an Zend-Form element. It shall be filled when the formclass is instantiated. Perhaps it is even the wrong idea?</p>
  
  <p>What I gonna do:</p>
  
  <p>I want to give a value to my formclass via my controller addAction:</p>
  
  <pre><code>$form = new PadForm(NULL, $test-&gt;UnitPartID);
  </code></pre>
  
  <p>Here is the constructor of my form class:</p>
  
  <pre><code> public function __construct($name = null, $unitpartid)
  </code></pre>
  
  <p>Now I thought it must be easy to give the value to an element:</p>
  
  <p>add.phtml</p>
  
  <pre><code>$UnitPartID= $form-&gt;get('UnitPartID');
  $UnitPartID-&gt;setAttribute('class', 'form-control');
  $UnitPartID-&gt;setAttribute('placeholder', 'UnitPartID');
  
  $UnitPartID-&gt;setValue($this-&gt;unitpartid);
  </code></pre>
  
  <p>Unfortunately the form element doesn't get the value.</p>
  
  <p>Where is the error? I think I'm quite close to the solution?? Any help appreciated.</p>