PHPackages                             chaplean/dto-handler-bundle - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. chaplean/dto-handler-bundle

AbandonedArchivedSymfony-bundle[Utility &amp; Helpers](/categories/utility)

chaplean/dto-handler-bundle
===========================

Loads the request content into a DTO

v2.3.3(6y ago)135.4k1[7 issues](https://github.com/NicolasGuilloux/chaplean-dto-handler-bundle/issues)[1 PRs](https://github.com/NicolasGuilloux/chaplean-dto-handler-bundle/pulls)MITPHPPHP &gt;=7.1

Since Jun 11Pushed 4y ago3 watchersCompare

[ Source](https://github.com/NicolasGuilloux/chaplean-dto-handler-bundle)[ Packagist](https://packagist.org/packages/chaplean/dto-handler-bundle)[ RSS](/packages/chaplean-dto-handler-bundle/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (14)Versions (16)Used By (0)

dto-handler-bundle
==================

[](#dto-handler-bundle)

This version of the bundle requires Symfony 3.4+.

[![Package version](https://camo.githubusercontent.com/0b251501ddf516bc8da6bd214ab1ec6f4d726460b5ea320a5d5ed8adb5ddfc5b/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f636861706c65616e2f64746f2d68616e646c65722d62756e646c652e737667)](https://packagist.org/packages/chaplean/dto-handler-bundle)[![Build Status](https://camo.githubusercontent.com/fb5737abd53ad571b32751d23ee6e1f52b80f4a72280453cc96bda426f5c7d21/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f4e69636f6c61734775696c6c6f75782f636861706c65616e2d64746f2d68616e646c65722d62756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/NicolasGuilloux/chaplean-dto-handler-bundle?branch=master)[![Coverage Status](https://camo.githubusercontent.com/0b256f8c060c999fa502ba5b3679ee9b9b963f2e7b504e88e852539a43951d48/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f4e69636f6c61734775696c6c6f75782f636861706c65616e2d64746f2d68616e646c65722d62756e646c652f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/NicolasGuilloux/chaplean-dto-handler-bundle?branch=master)[![contributions welcome](https://camo.githubusercontent.com/9e93e892d0685e1bf7a1d0bd7c8410d6ecf2086a0a7b48dd58a6b96fa556ea2a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f636f6e747269627574696f6e732d77656c636f6d652d627269676874677265656e2e7376673f7374796c653d666c6174)](https://github.com/NicolasGuilloux/chaplean-dto-handler-bundle/issues)[![License](https://camo.githubusercontent.com/4141875b9db06b6e19ee4c8c4f14f34b47dabb4fcdad7816e338a79666b0aacb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d7265642e737667)](LICENSE.md)

The dto-handler-bundle loads the content of a request into a Data Transfer Object (DTO), mapping its properties such as entities from the database. It uses the `ParamConverterInterface` provided by the [SensioLabs Framework Extra Bundle](https://symfony.com/doc/4.0/bundles/SensioFrameworkExtraBundle/index.html) to automatically map the request content to the appropriate variables.

Quick Start
-----------

[](#quick-start)

The dto-handler-bundle is simple to use as it requires almost no configuration. To use it in a controller, simply declare the variable in the controller's argument:

```
public function postAction(DummyDataTransferObject $dto): Response
{
   // ...
}
```

And add the `DTO` annotation to your DTO:

```
/**
 * @DTO
 */
final class DummyDataTransferObject
{
    // ...
}
```

Table of content
----------------

[](#table-of-content)

1. [Installation](#1-installation)
2. [Getting started](#2-getting-started)
    - [Set up the Data Transfer Object](Doc/DataTransferObject.md)
    - [Configure the ParamConverter](Doc/ParamConverter.md)
    - [Some utilities](Doc/Utilities.md)
3. [Example](#3-example)
4. [Versioning](#4-versioning)
5. [Contributing](#5-contributing)
6. [Hacking](#6-hacking)
7. [License](#7-license)

1. Installation
---------------

[](#1-installation)

This bundle required at least Symfony 3.4.

You can use [composer](https://getcomposer.org) to install dto-handler-bundle:

```
composer require chaplean/dto-handler-bundle
```

Then, enable the bundle by adding it to the list of registered bundles in the `app/AppKernel.php` file of your project:

```
