title: zend_form: should I use one right in the layout
body: <p>I usually instantiate my forms in an action and that's where I process them when they're submitted. I then pass them on to the view and output them there as usual.</p>
  
  <p>This form (a search box) is different because it's not part of a single page. It has to be visible everywhere. I've made it part of the template <code>layout.phtml</code> and instantiated and accessed it right there. </p>
  
  <pre><code>$search = new SearchForm(); 
  echo $search;
  </code></pre>
  
  <p>The form prints out fine but the question now is where do I handle this form. I usually have processing code like this in the action.. </p>
  
  <pre><code>    if ($this-&gt;_request-&gt;isPost()) {
          //and form is valid
          //process the data            
      }
  </code></pre>
  
  <p>but since this form is universal, there's no action for it. How should I handle this? </p>
  
  <p>Should I: </p>
  
  <ul>
  <li>create a dummy action for it (which doesn't make sense because the form is everywhere) </li>
  <li>or should I put the processing code right into the layout.phtml (which I think is bad MVC practice because I'm now mixing processing the form with the view). </li>
  </ul>
  
  <p>What should I do? Any advice on this?</p>