I already searched but didn’t find the right topic. But I’m pretty sure I’m not the first one having this issue.
I have a form which collects data for different models. I set some validation rules in models as well as in the form. That works, sure.
BUT: You need to keep those rules in sync.
Model A with rules for attributes a1 and a2
Model B with rules for attributes b1 and b2
Form X with rules for attributes a1, a2, b1 and b2.
I want to keep rules in model, but want to use the same in form to be sure that both validate the same stuff.
So what I thought would be nice to tell the form to use the validation rules from the corresponding models so that I only have to touch the model if I want to change the rules.
Or maybe just outsourcing the rules.
Does yii have that possibility built in or does someone has an idea how to solve that?