I think better create model (without table) even if you'll use it only for this validation. The only other "native" way I see is use multivalidate behavior with some of already existing model - but only if there is any model that logically connected with this action.
http://bakery.cakephp.org/articles/view/multivalidatablebehavior-using-many-validation-rulesets-per-model http://snook.ca/archives/cakephp/multiple_validatable_behavior On Oct 20, 9:39 pm, Céryl <c.a.h.wilt...@student.tue.nl> wrote: > Hello all, > > On my site I have a contact page (which is just pages/contact, with a > small form where users can enter their name and some text. After > clicking the button, an action in my controller (Actually a loose > controller called mails_controller, without views and a model) is done > which sends the mail back to me with the text the users enter. > > However, how can I validate stuff in this form without a model? > Specifically, I like to use the rule => email and rule => notEmpty > from the standard model validation, but I need them in my controller. > > Is there a way to use them in a controller function (without creating > a model i'll probably never use) or should I just do the validation by > hand (i.e. checking if the emailadres looks like x...@xxx.xxx with php > stringfunctions etc.)? > > Thanks! --~--~---------~--~----~------------~-------~--~----~ 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+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php?hl=en -~----------~----~----~----~------~----~------~--~---