简体   繁体   中英

Add YAML validation file in Symfony 4

如何在/config/validation.yaml添加文件作为映射验证,以避免在DTO中使用注释

Is quite simple.

Just add in validator.yaml file the following:

framework:
    validation:
        email_validation_mode: html5
        mapping:
          paths:
            - '%kernel.project_dir%/src/<path to validation file>'

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM