title: cakephp validation from both model and controller
body: <p>I have given validation in model. Also, I have given some validation in controller for checking the captcha code. After that, the application is not displaying the model validation errors. If I comment the controller code, model validation is working fine and displaying the errors. Both not working.. </p>
  
  <p>Model code (sample)</p>
  
  <pre><code>class User extends AppModel {
  
  var $name = 'User';
  
  var $validate = array(
      'username' =&gt; 'notempty',
      'firstname' =&gt; 'notempty'
      );
  </code></pre>
  
  <p>}</p>
  
  <p>Controller code</p>
  
  <pre><code>if (!empty($this-&gt;data)) {
  
  $this-&gt;User-&gt;set($this-&gt;data);
  $this-&gt;User-&gt;create();
  $captcha = $this-&gt;Session-&gt;read('CAPTCHA_CODE');
  
  if (strtolower($captcha) != strtolower($this-&gt;data['User']['captcha']))
  {
      $this-&gt;User-&gt;invalidate('captcha', __('Sorry, your entry did not match', true));
  }
  
  if ($this-&gt;User-&gt;save($this-&gt;data, array('validate' =&gt; 'only')))
  {
      if ($this-&gt;User-&gt;save($this-&gt;data, array('validate' =&gt; 'false'))) {
          $this-&gt;Session-&gt;setFlash(__('Registered successfully', true));
          $this-&gt;redirect('success');
      }
  }else {
      $this-&gt;Session-&gt;setFlash(__('Please, try again.', true));
  }
  </code></pre>
  
  <p>}</p>
  
  <p>I have replaced the <code>if ($this-&gt;User-&gt;save($this-&gt;data, array('validate' =&gt; 'only')))</code> line with <code>if ($this-&gt;User-&gt;validates())</code>, then also it is not working.</p>
  
  <p>please help</p>