Add some custom validation methods to your model , and inside these methods
you can perform a check to determine if the validation really needs to be
executed or if you can simple return true.


On Tue, Oct 6, 2009 at 7:22 AM, #2Will <willjbar...@gmail.com> wrote:

>
> Hi all,
>
> Is it possible to have different validation for  a form for the same
> model, depending on circumstance. ?
>
> eg, if a user leavers a comment when not logged in, entering their
> email address is required - but when logged in it isn't.   So in the
> Admin area, i don't want to require it (because some records won't
> have a email address, so the validation will stop me saving changes to
> the record) but on the web site, i do.
>
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to