PHPackages                             batenburg/response-factory-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. batenburg/response-factory-bundle

ActiveLibrary

batenburg/response-factory-bundle
=================================

A response factory bundle, to clean your controller code.

v1.1.8(5y ago)16.5k1[1 issues](https://github.com/batenburg/response-factroy-bundle/issues)MITPHPPHP &gt;= 7.2.0

Since Jan 25Pushed 4y ago1 watchersCompare

[ Source](https://github.com/batenburg/response-factroy-bundle)[ Packagist](https://packagist.org/packages/batenburg/response-factory-bundle)[ RSS](/packages/batenburg-response-factory-bundle/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (7)Versions (27)Used By (0)

Response factory bundle
=======================

[](#response-factory-bundle)

Response factory for the Symfony Framework.

Build Status: [![Build Status](https://camo.githubusercontent.com/1b98858b526af65f0b4afba8e130b63b1208ae3222e996d865a0d207e91cae75/68747470733a2f2f7472617669732d63692e636f6d2f626174656e627572672f726573706f6e73652d66616374726f792d62756e646c652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/batenburg/response-factroy-bundle.svg?branch=master)

What is Response factory Bundle?
--------------------------------

[](#what-is-response-factory-bundle)

The response factory bundle is a bundle with a response factory, to make clean code in your Symfony controllers. It is inspired by the response factory from laravel.

For who?
--------

[](#for-who)

Everybody who loves clean code.

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

[](#installation)

Install with composer:

```
composer require batenburg/response-factory-bundle

```

Register the bundle, add the following line to `config/bundles.php`:

```
    Batenburg\ResponseFactoryBundle\ResponseFactoryBundle::class => ['all' => true],

```

Usage
-----

[](#usage)

After the installation is completed, the ResponseFactoryInterface can be resolved by dependency injection. Or through the container. It is highly recommended to use dependency injection.

An example::

```
