Form. Should we allow adding errors externally?

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

0 voters

1 Like

Only want to return error array, do not want to embed any front-end code, if possible, can be implemented in other extensions.

Sure. That’s not planned.

The flexibility is what makes Yii awesome, more compatibility and less breaking changes with Yii2 is -IMO- high priority.

@bitsnaps Yii 3 is already breaking almost everything (except concepts).

@samdark, Great! so we need to prepare a good yii2-migration-to-yii3 tutorial, otherwise be ready for huge amount of tickets!

Yes. Will try to cover it after releasing beta.