-
Notifications
You must be signed in to change notification settings - Fork 23
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
validation_groups can be a closure #22
Comments
Ok. |
For now I don't have access to the form to do this. |
i just looked a bit into it and maybe it isn't possible to realize something like this in a simple way :S |
The closure for the validation_group needs a Form object but we have only the FormView object. If your code doesn't need this form object in the closure, we can pass a fake Form object. |
The problem is not misrepresented that the form is not available but that closure is called on form post-bind event. |
yes.. so there is no simple way.. the "form object" is what is needed inside the closure.. else it doesn't make sense to have one.. |
First of all we should fix code to avoid error messages. After that, you'll be able at least use custom js code. |
In this bundle validation_groups is used only for filtering the fields, that should not be checked. |
Are we close this issue ? |
since Symfony 2.1 the validation_groups of the form view can be closures (http://symfony.com/doc/master/book/forms.html#groups-based-on-submitted-data).
It would be nice if the APYJsFormValidationBundle can be used with them too... at the moment there is thrown an error as followed:
An exception has been thrown during the rendering of a template ("Warning: in_array() expects parameter 2 to be array, object given in .../vendor/apy/jsfv-bundle/APY/JsFormValidationBundle/EventListener/ValidationGroupsListener.php line 35") in The Bundle::template.html.twig at line xx.
The text was updated successfully, but these errors were encountered: