Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[Form] getErrorsAsArray for Form class#7977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
TomiS commentedMay 8, 2013
Here's an example of output (serialized in JSON for better readability) |
raziel057 commentedMay 8, 2013
I already created a PR for this feature but there is place for improvements. See#7512 |
TomiS commentedMay 8, 2013
@raziel057 Oh... I guess I should have searched existing PRs a bit more intensively before coding :) Anyway, just adding weight for importance of this then. |
TomiS commentedMay 8, 2013
Btw. Here's a similar workaround implementation for those who need it right now: |
With this new handy method Form class is now able to provide all validation errors of a form (and its child forms) in a beautiful associative array tree that can, for example, easily be serialized to JSON for API responses and such. It seems quite a few people (including me) have had problems with the lack of this feature. At least this is the impression I had while browsing through questions in stackoverflow etc.
Implementation is similar to existing helper method
getErrorsAsStringso this one should behave however it behaves.So... Any future for this?