Right, that was a typo, not a paste. I think that you'll be able to
better help me if you understand how I've designed my contact form:

Model: Contact[name, email, city, subject, message, and a couple
others]
Model['validate']: Name, email, and message have 'required' => true
Views: index (just passes in a pageTitle from the controller and
renders a form from the model using $this->form->create('Contact') or
equivalent -- works fine. This form automatically mapped to
ContactsController::add(), so I created that method and put all of the
relevant mail logic in there.

So should I move this logic into index() and force the form to use
that method? Or force a render of the index view and find some way to
pass in the validation errors?

Thanks for the help!

On Sep 18, 9:29 am, "David C. Zentgraf" <[EMAIL PROTECTED]> wrote:
> On 18 Sep 2008, at 21:50, 703designs wrote:
>
> > I got funny preg_match errors
>
> Show us your $validate rules then or go through them with a fine comb.
>
> > $this->Contact->set('$this->data);
>
> I hope this is not copy&pasted as it's invalid PHP.
>
> > 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)?
>
> What view is your form in then? The add action will automatically try  
> to render the add view, naturally. If this is not where your form is,  
> override it with $this->render();
>
> > This is not very well-documented, or
> > if it is, I had difficulty finding an answer.
>
> http://book.cakephp.org/view/428/render
--~--~---------~--~----~------------~-------~--~----~
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 [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to