PHPackages                             netmex/response - 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. [HTTP &amp; Networking](/categories/http)
4. /
5. netmex/response

ActiveSymfony-bundle[HTTP &amp; Networking](/categories/http)

netmex/response
===============

v2.0.1(1mo ago)019MITPHPPHP &gt;=8.2

Since May 13Pushed 1mo agoCompare

[ Source](https://github.com/netmexmedia/Response)[ Packagist](https://packagist.org/packages/netmex/response)[ RSS](/packages/netmex-response/feed)WikiDiscussions main Synced today

READMEChangelog (2)Dependencies (7)Versions (3)Used By (0)

Netmex Response Bundle
======================

[](#netmex-response-bundle)

About
-----

[](#about)

The Netmex Response Bundle is a lightweight Symfony response layer that allows controllers to return simple DTOs instead of manually building `Symfony\Component\HttpFoundation\Response` objects.

The bundle transforms these DTOs into real HTTP responses using **attribute-based metadata and pluggable strategies**.

It helps you:

- Keep controller actions focused (return objects, not Response plumbing).
- Centralise output formatting (JSON, HTML, files, redirects, streams, text, no-content).
- Extend output formats by adding custom strategies.
- Avoid repetitive mapping or manual response building.

Installation
------------

[](#installation)

```
composer require netmex/response
```

Core concept
------------

[](#core-concept)

The system is built around two main ideas:

- DTO (Response Object) → defines the response shape + metadata.
- Strategy → converts payload into a Symfony Response.

Usage
-----

[](#usage)

You return a DTO from your controller. The bundle automatically transforms it into a Response.

### DTO + Attribute (recommended)

[](#dto--attribute-recommended)

This is the main way of using the bundle.

#### Example DTO

[](#example-dto)

```
