In Symfony2, can the validation.yml file be split into multiple files using imports?

前端 未结 8 1091
旧巷少年郎
旧巷少年郎 2020-12-13 10:48

Right now, I have a file called validation.yml with the validation of all the bundle\'s entities in one file.

validation.yml

Blogger\\BlogBundle\\Ent         


        
相关标签:
8条回答
  • 2020-12-13 11:24

    Since Symfony 3.3 all files present in YourBundle/Resources/config/validation/* are registered.


    Since Symfony 3.4 all files present in %kernel.project_dir%/config/validator/* are also registered.

    0 讨论(0)
  • 2020-12-13 11:29

    You can add to your services.xml

    <parameters>
        <parameter key="validator.mapping.loader.yaml_files_loader.mapping_files" type="collection">
            <parameter>Blogger\BlogBundle\Resources\config\comment.yml</parameter>
            <parameter>Blogger\BlogBundle\Resources\config\enquiry.yml</parameter>
        </parameter>
    </parameters>
    
    0 讨论(0)
提交回复
热议问题