stas-plov/dto-validator-bundle
最新稳定版本:v1.1.4
Composer 安装命令:
composer require stas-plov/dto-validator-bundle
包简介
Adds validator for middleware request support in your Symfony application
README 文档
README
StasPlovDtoValidatorBundle
About
The StasPlovDtoValidatorBundle Validating the Request by DTO in the context of symfony.
The core idea of StasPlovDtoValidatorBundle is to validate input data in the controller from the Request using so-called DTO (Data Transfer Object) entities.
#[ValidateDto(class: CreateDto::class)] #[Route(path: '/create/user', name: 'api-user-create', methods: ['POST'])] public function createUser(CreateDto $createDto): Response { // ... some code }
The $createDto variable will contain all the data described in the corresponding CreateDto class.
Installation
Require the stas-plov/dto-validator-bundle package in your composer.json and update your dependencies:
composer require stas-plov/dto-validator-bundle
Flex, you'll need to enable it manually as explained in the docs.
Usage
See the documentation for usage instructions.
License
Released under the MIT License, see LICENSE.
统计信息
- 总下载量: 185
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-01-09