CakePHP: Same model, set up per form validation rules?
Posted
by mwaterous
on Stack Overflow
See other posts from Stack Overflow
or by mwaterous
Published on 2010-05-26T04:59:22Z
Indexed on
2010/05/26
5:01 UTC
Read the original article
Hit count: 296
I have a single model in CakePHP that has multiple forms on different pages of the site that I would like to validate differently even where the field name is the same - I have discovered that you can set 'on' to create|update which has been a handy discovery but I am wondering if there is any other way of explicitly declaring rules based on the form that was submitted?
Just to rephrase for clarity, form a and form b contain fields of the same name, but if form a is submitted the fields in question should be validated differently than if they were submitted from form b. Possible?
© Stack Overflow or respective owner