in this conditional didn't work: I got funny preg_match errors (also
noted here:
http://ryan.ifupdown.com/2008/08/24/delimiter-must-not-be-alphanumeric-or-backslash-corecakelibsmodelmodelphp-line-2202/
, although his fix didn't work for me):
function add() {
if(!empty($this->data)) {
$this->Contact->set('$this->data);
if($this->Contact->validates()) {
// Start sending messages, then flash a success message if
successful. Redirect to site root
}
}
}
I also got an error about a missing 'add' view which is probably
easier to fix. This controller's 'add' method just sends out emails
and flashes a message to the homepage. What do I need to do for the
form to point to this method, but for validation errors to show up on
the form (repopulating fields)? This is not very well-documented, or
if it is, I had difficulty finding an answer.
On Sep 18, 4:44 am, "David C. Zentgraf" <dec...@gmail.com> wrote:
> Are you looking for this?http://book.cakephp.org/view/410/Validating-Data-from-the-Controller
>
> On 18 Sep 2008, at 13:51, 703designs wrote:
>
>
>
> > How can I check if the data is valid before trying to send the mail
> > out? Validation errors are falling into the "email failed" condition,
> > and validation errors aren't reported to the user.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to cake-php+unsubscribe@googlegroups.com
For more options, visit this group at http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---
No comments:
Post a Comment