Hi,

Check if the validation errors has any data or not. The code for this will
be something like

if ($this->User->save($this->data)) {
    $this->Session->setFlash(__('Your account information has been saved',
true));
    $this->redirect(array('controller' => 'users', 'action' => 'view'));
} else {
    debug($this->User->validationErrors);
    $this->Session->setFlash(__('Sorry, a problem occurred trying to save
your account information. Please, try again.', true));
}

Amit Badkas

PHP Applications for E-Biz: http://www.sanisoft.com



On Fri, Jan 7, 2011 at 10:55 AM, alvinj <[email protected]> wrote:

> if ($this->User->save($this->data)) {
>          $this->Session->setFlash(__('Your account information has
> been saved', true));
>          $this->redirect(array('controller' => 'users', 'action' =>
> 'view'));
>        } else {
>          $this->Session->setFlash(__('Sorry, a problem occurred
> trying to save your account information. Please, try again.', true));
>        }
>

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to