Can you please tell me there is some trick for validating input data when the rules are very complicated. I use the YII2 rules () to validate the attributes of the API entity, but at some point there are so many rules that it is very difficult to understand and view them all.
1 answer
Perhaps you should create standalone validators . (To check on the client - see here )
- They help, if you need to somehow somehow validate one attribute, and if the attributes depend on each other, then hell begins, so that all these connections can be disassembled, you need to look through all the rules and scroll through them in your head - Oleg Khamov
- @OlegKhamov Maybe you should break your form into several simple ones? - NPreston
|