title: how to validate a registration form in zend framework 2?
body: <p>i am trying to validate a user registration form in Zend Framework 2. </p>
  
  <p>More specifically how to validate the email, ZF1 i could do:</p>
  
  <pre><code>$email-&gt;setValidators( array(new Zend_Validate_EmailAddress()) );
  </code></pre>
  
  <p>I'm wondering if i can just call something similar like this.</p>
  
  <p>Also I'm wondering how to validate two fields that need to be the same like the password field and the password verification.</p>
  
  <p>I guess that when i say <code>if($form-&gt;isValid())..</code> this will check the <code>getInputFilter()</code> method for all validation.</p>
  
  <p>I've been taking a look at <a href="https://github.com/ZF-Commons/ZfcUser" rel="nofollow">ZfcUser</a> module but, right now, i can't understand much since i don't have a full grasp on how ZF2 works</p>
  
  <p>Any ideas, maybe a simple example?</p>
  
  <p>thanks</p>