PHPackages                             glaubinix/symfony-template-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. [Templating &amp; Views](/categories/templating)
4. /
5. glaubinix/symfony-template-response

AbandonedArchivedLibrary[Templating &amp; Views](/categories/templating)

glaubinix/symfony-template-response
===================================

symfony template response silex

3.1(8y ago)220MITPHP

Since Dec 28Pushed 8y ago1 watchersCompare

[ Source](https://github.com/glaubinix/symfony-template-response)[ Packagist](https://packagist.org/packages/glaubinix/symfony-template-response)[ RSS](/packages/glaubinix-symfony-template-response/feed)WikiDiscussions master Synced today

READMEChangelog (1)Dependencies (5)Versions (6)Used By (0)

symfony-template-response
=========================

[](#symfony-template-response)

Build status: [![Build Status](https://camo.githubusercontent.com/0bbe081bb0a50760c3a72948aeb1bf0b88a6e39c55a109b7afce7fde3d5399cc/68747470733a2f2f7472617669732d63692e6f72672f676c617562696e69782f73796d666f6e792d74656d706c6174652d726573706f6e73652e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/glaubinix/symfony-template-response)

Using the TemplateResponse will help you to build Controllers which are not tightly coupled to a certain Framework. In the case of Symfony/Silex this mostly means not injecting the ServiceContainer/Application to your Controllers.

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

[](#installation)

The easiest way to install this library is to use [Composer](http://getcomposer.org/). Add the package "glaubinix/symfony-template-response" to your composer.json.

```
{
    "require": {
        "glaubinix/symfony-template-response": "@stable"
    }
}
```

Usage
-----

[](#usage)

To be able to use the TemplateResponse simply register the Listener.

#### Usage with symfony framework bundle

[](#usage-with-symfony-framework-bundle)

If you are using the framework bundle simply add this to your service config.

```

```

#### Usage with silex and twig

[](#usage-with-silex-and-twig)

If you are using silex make sure the templating Engine is registered then register the ServiceProvider which is provided with this library.

```
// In a Provider define the templating engine
$app['templating'] = function(Container $app) {
    return new Symfony\Bridge\Twig\TwigEngine($app['twig'], new \Symfony\Component\Templating\TemplateNameParser());
};

// Register the provider
$app->register(new Glaubinix\TemplateResponse\Silex\TemplateResponseServiceProvider());

// Use the response in
$app->get('/', function() {
    return new TemplateResponse('template', []);
});
```

Notes
-----

[](#notes)

To make this fully decoupled from Frameworks the TemplateResponse would not have to extend the Symfony Response and instead of simply rendering the content we would have to replace the Response. Once this is done a dedicated ResponseListener for every Framework would allow the usage in all Frameworks.

Maintaing sounds like a huge pain and I dont really see this happening :)

Original idea
-------------

[](#original-idea)

First time I saw this idea was in [QafooLabsNoFrameworkBundle](https://github.com/QafooLabs/QafooLabsNoFrameworkBundle/) the implementation is slightly different and depends on the symfony framework bundle which is main the reason I build a simple version for silex.

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~276 days

Total

5

Last Release

3099d ago

Major Versions

1.0 → 2.0.02015-02-04

2.1.0 → 3.02016-05-23

### Community

Maintainers

![](https://www.gravatar.com/avatar/2969e5fd81aa79b482a247226409a0b55ed82c4587d40264633425b6b4a22a21?d=identicon)[glaubinix](/maintainers/glaubinix)

---

Top Contributors

[![glaubinix](https://avatars.githubusercontent.com/u/442056?v=4)](https://github.com/glaubinix "glaubinix (19 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/glaubinix-symfony-template-response/health.svg)

```
[![Health](https://phpackages.com/badges/glaubinix-symfony-template-response/health.svg)](https://phpackages.com/packages/glaubinix-symfony-template-response)
```

###  Alternatives

[symfony/http-kernel

Provides a structured process for converting a Request into a Response

8.1k869.4M8.8k](/packages/symfony-http-kernel)[symfony/framework-bundle

Provides a tight integration between Symfony components and the Symfony full-stack framework

3.6k251.7M11.6k](/packages/symfony-framework-bundle)[pimcore/pimcore

Content &amp; Product Management Framework (CMS/PIM/E-Commerce)

3.8k3.8M508](/packages/pimcore-pimcore)[easycorp/easyadmin-bundle

Admin generator for Symfony applications

4.3k17.9M386](/packages/easycorp-easyadmin-bundle)[symfony/security-bundle

Provides a tight integration of the Security component into the Symfony full-stack framework

2.5k185.6M2.4k](/packages/symfony-security-bundle)[api-platform/core

Build a fully-featured hypermedia or GraphQL API in minutes!

2.6k51.2M339](/packages/api-platform-core)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
