>    - how and where do I deal with validation?
1. Create a model with whatever name but put in a class property of
var $useTable = false; Cake will happily use this model without
complaining that there is no DB table.
2. Put your validation rules in this model and run validation as you
would any normal model. You can do validation without doing saves by
doing (in your controller):

$this->{your model name}->set($this->data);
if($this->{your model name}->validates()) {
 // everything is cool, go to the next step
} else {
 // oops there was an error. Get the validation errors if you want to
like this
$errors = $this->{your model name}->validationErrors;
}

>    - where do I put the distribution function? Model? Controller?
Personal preference to an extent. My preference would be to not put it
in the controller. Ideally it should go in a model, but if it needs
access to Cake components like Session, then put it in a component.

Ian


lemp wrote:
> I'm using Cake 1.2.0.5875 pre-beta
--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to