Description
Right now, to use the validator component within a Symfony application, we need to configure the validation constraints as annotations or in XML or Yaml files in the Resources/config/validation
directory or in a big Resources/config/validation.[x|y]ml
file in a bundle directory.
In order to be able to re-use validation across libraries or just make the validation living where the user wants, I propose to introduce a validation mapping configuration in the framework
configuration:
framework:
validation:
mappings:
- %kernel.root_dir%/../src/Acme/Demo/Resources/validation
- %kernel.root_dir%/../src/Acme/Library/Resources/validation.yml
The mapping values can be either a directory or a file. If it's a file, will be added as YML or XML based on the extension. If it's a directory, then using the finder we will be able to locate all the *.[x|y]ml
files.
Before PR this feature, what do you think about it ?