I would do something like this:
items_controller.php
function foo(){
if (!empty($this->data)) { //check if there is data sent
if($this->User->field('email', array('conditions' =>
array('email' => $this->data['User']['email'])))){ //find the emai in the
database
} else { //email not found
//your requestAction call
}
}
}
On 10 February 2010 01:09, dtirer <[email protected]> wrote:
> I have a form with an 'Item' and 'email' field. It submits to an
> Items Controller.
> I want to validate both fields, however, the 'email' is technically
> part of a User model.
>
> So what happens is, when the form is submitted, it's supposed to
> search for the Item in the form. it also check if the email is
> already in the DB, and if it isn't it does a requestAction to the
> UsersController, and runs the email through the signup() function, and
> then goes back to finishing the Items Controler work.
>
> So how do I go about validating the Email field?
>
> 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]<cake-php%[email protected]>For
> more options, visit this group at
> http://groups.google.com/group/cake-php?hl=en
>
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