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

v1.0.2 2024-09-03 14:28 UTC

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.