title: validation in mvc php
body: <p>I don't know which one is the best?
  do you think it's better to validate <code>user login form</code> or other forms in controller or it's better to define one class for example 'security class' in model to validation?
  or define some classes for validation?
  do you know a better choice or good technique?</p>
  
  <pre><code>&lt;?php
  class acontroller{
  .
  .
  .
  private function loginformAction()
  {
      $this-&gt;actionform='loginform';
      $this-&gt;errorMsg=array();
      if(isset($post)){
          if(empty($post('aliasName'))){
                         ...
          }else{
             ...
                      }
          if(empty($post('password'))){
                        ...
          }
          if(empty($post('re_password'))){
                        ...   
          }
          if(!empty($post('password')) &amp;&amp; isset($post('re_password')) ){
                        ...
          }
      }
  
      $this-&gt;render();
  }
    .
    .
    .
   }   
  </code></pre>