I did it like this

<?php
class Contact extends AppModel
{
    var $name = 'Contact';
    var $validate = array('email'=>VALID_EMAIL, 'name'=>VALID_NOT_EMPTY,'text'=>VALID_NOT_EMPTY,'regards'=>VALID_NOT_EMPTY);
    var $useTable = false;

}

?>

the $useTable means that it doesn't connect to the db and I can use the validation stuff that way

then in the controller rather then testing $this->ModelName->save() I do

$this->Contact->validates($this->params['data'] )

Works for me ;)
Sam D

On 4/9/06, guice666 < [EMAIL PROTECTED]> wrote:

Looked through the tutorials, trying to do it through a form with no
success. Is there a way to run form validation w/out the requirement of
a model?

I have a contact form that is not connected to any database model that
I need to run validation against the inputted values before sending it
off. So far the only auto validation I can see is done through the
model level. Since this class doesn't hit the model level, I don't know
how else to run an auto validation check. So I have to check all values
manually?

Thanks



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake PHP" 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to