How to Disable the Validation of Submitted Data

Version: 2.8
Edit this page

Warning: You are browsing the documentation for version 2.8 which is not maintained anymore.

If some of your projects are still using this version, consider upgrading.

How to Disable the Validation of Submitted Data

New in version 2.3

The ability to set validation_groups to false was introduced in Symfony 2.3.

Sometimes it is useful to suppress the validation of a form altogether. For these cases you can set the validation_groups option to false:

use Symfony\Component\OptionsResolver\OptionsResolver;

public function configureOptions(OptionsResolver $resolver)
        'validation_groups' => false,

Note that when you do that, the form will still run basic integrity checks, for example whether an uploaded file was too large or whether non-existing fields were submitted.

The submission of extra form fields can be controlled with the allow_extra_fields config option and the maximum upload file size should be handled via your PHP and web server configuration.

This work, including the code samples, is licensed under a Creative Commons BY-SA 3.0 license.