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

前端 未结 8 1151
旧巷少年郎
旧巷少年郎 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-13 11:02

    This is YAML alternative to @MaksSlesarenko answer.

    parameters:
      validator.mapping.loader.yaml_files_loader.mapping_files:
        - "%kernel.root_dir%/../src/CompanyName/TestBundle/Resources/config/validation/Entity.DbObject.yml"
    

    BTW is there any way to change %kernel.root_dir%/../src/CompanyName/TestBundle/ to some bundle root variable (like %kernel.root_dir%)?

提交回复
热议问题