ALso sorry. Im trying to do this in the controller.
Anyway I'll keep diggign through the archives...
On Aug 21, 6:08 pm, rocket <[EMAIL PROTECTED]> wrote:
> also I'm using cake 1.1 if it makes a diff.
>
> On Aug 21, 6:05 pm, rocket <[EMAIL PROTECTED]> wrote:
>
> > Hello. Anyone know why when i run this, it just totally skips the
> > second validation? THe weird thing is if I take the line
> > $this->User->save($this->data) out, both errors properly show. With the
> > line, only
>
> > the first error shows and the second seems to get ignored.
>
> > function register()
> > {
> > if (!empty($this->data))
> > {
> > $user = $this->User->findByUsername($this->data['User']
> > ['username']);
> > if(!empty($user['User']['username']))
> > {
> > $this->User->invalidate('username_unique');
> > }
>
> > if($this->data['User']['password'] !=
> > $this->data['User']['password_confirm'])
>
> > {
> > $this->User->set($this->data);
> > $this->User->invalidate('password_confirm');
> > }
>
> > $email = $this->User->findByEmail($this->data['User']
> > ['email']);
>
> > if(!empty($email['User']['email']))
> > {
> > $this->User->invalidate('email_unique');
> > }
>
> > if ($this->User->save($this->data))
> > {
> > $this->flash('Your register has
> > been a success.','/');
> > }
> > }
> > }
>
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---