macpaw / request-dto-resolver
Request DTO resolver bundle
Installs: 4 439
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 15
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=8.0
- symfony/form: ^6.4|^7.0
- symfony/framework-bundle: ^6.4|^7.0
- symfony/validator: ^6.4|^7.0
Requires (Dev)
- escapestudios/symfony2-coding-standard: 3.x-dev
- phpstan/phpstan: ^1.0
- phpunit/phpunit: ^10.0
- slevomat/coding-standard: ^8.0
- squizlabs/php_codesniffer: ^3.0
- symfony/yaml: ^6.4|^7.0
This package is auto-updated.
Last update: 2024-11-03 15:07:29 UTC
README
Automatically parses Symfony HTTP request, validates parameters, hydrates DTO and passes it as an argument to your controller.
Installation
Open a command console, switch to your project directory and execute:
composer require macpaw/request-dto-resolver
Your bundle now should be automatically added to the list of registered bundles.
// config/bundles.php <?php return [ RequestDtoResolver\RequestDtoResolverBundle::class => ['all' => true], // ... ];
If your application doesn't use Symfony Flex you need to manually add your bundle
to the list of registered bundles in config/bundles.php
file.
Create bundle config
# config/packages/request_dto_resolver.yaml` request_dto_resolver: target_dto_interface: <target_dto_interface>
You need to specify the interface which your target controller argument implements. See tests for example.