The form in Yii 3 is alike model in Yii 2. It’s purpose is to contain data collected from request, validate it, add ability to get/save it and provide information that is needed to render HTML for the form (labels, placeholders etc.).
After some thinking we’ve decided to isolate validation so it’s defined in a single place - the form itself.
But it seems there’s no agreement that this is a good practice:
So the question is should we allow adding errors to the form externally?
- Yes, allow it
- No, do not allow it