PHPackages                             symfony-util/controller-using-templating-http-foundation - 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. symfony-util/controller-using-templating-http-foundation

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

symfony-util/controller-using-templating-http-foundation
========================================================

Controller which renders a template and returns a response (HttpFoundation)

5.4.x-dev(7y ago)0844ISCPHP

Since Mar 11Pushed 7mo ago1 watchersCompare

[ Source](https://github.com/symfony-util/controller-using-templating-http-foundation)[ Packagist](https://packagist.org/packages/symfony-util/controller-using-templating-http-foundation)[ Docs](https://github.com/symfony-util/controller-using-templating-http-foundation)[ RSS](/packages/symfony-util-controller-using-templating-http-foundation/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (6)Versions (3)Used By (0)

controller-using-templating-http-foundation
===========================================

[](#controller-using-templating-http-foundation)

Controller which renders a template and returns a response (HttpFoundation)

[![PHPPackages Rank](https://camo.githubusercontent.com/e7f3d974c639283f413336870a3d175e5f2bd1438b0dd01530a3a6d41ce291e8/68747470733a2f2f7068707061636b616765732e6f72672f702f73796d666f6e792d7574696c2f636f6e74726f6c6c65722d7573696e672d74656d706c6174696e672d687474702d666f756e646174696f6e2f62616467652f72616e6b2e737667)](https://phppackages.org/p/symfony-util/controller-using-templating-http-foundation)[![Monthly Downloads](https://camo.githubusercontent.com/bc285f3d5fb4f434d7f0a36c2a657fa5817e7aba661b515aba22645d314d0b41/68747470733a2f2f706f7365722e707567782e6f72672f73796d666f6e792d7574696c2f636f6e74726f6c6c65722d7573696e672d74656d706c6174696e672d687474702d666f756e646174696f6e2f642f6d6f6e74686c79)](https://packagist.org/packages/symfony-util/controller-using-templating-http-foundation)[![PHPPackages Referenced By](https://camo.githubusercontent.com/016b9c3ceac59f5cc34460e8cb2782d23660e01b454edeea5e1d59a0f5dd4731/68747470733a2f2f7068707061636b616765732e6f72672f702f73796d666f6e792d7574696c2f636f6e74726f6c6c65722d7573696e672d74656d706c6174696e672d687474702d666f756e646174696f6e2f62616467652f7265666572656e6365642d62792e737667)](https://phppackages.org/p/symfony-util/controller-using-templating-http-foundation)[![Tested PHP Versions](https://camo.githubusercontent.com/20ac4856451d2cac72038f50ea4b2723fba0b031c9fd25e75583e38ff7412cea/68747470733a2f2f7068702d6579652e636f6d2f62616467652f73796d666f6e792d7574696c2f636f6e74726f6c6c65722d7573696e672d74656d706c6174696e672d687474702d666f756e646174696f6e2f7465737465642e737667)](https://php-eye.com/package/symfony-util/controller-using-templating-http-foundation)[![Dependency Status](https://camo.githubusercontent.com/f994c058e3ccc62b7ab8186a93d91a3c89e48060021d53d630e6640135671e8b/68747470733a2f2f7777772e76657273696f6e6579652e636f6d2f7068702f73796d666f6e792d7574696c3a636f6e74726f6c6c65722d7573696e672d74656d706c6174696e672d687474702d666f756e646174696f6e2f6261646765)](https://www.versioneye.com/php/symfony-util:controller-using-templating-http-foundation)[![Build Status](https://camo.githubusercontent.com/2ef67bfc1dd976db6b9c94c98a1e86db548b97816a0d399280f00e63d6fcde83/68747470733a2f2f7472617669732d63692e6f72672f73796d666f6e792d7574696c2f636f6e74726f6c6c65722d7573696e672d74656d706c6174696e672d687474702d666f756e646174696f6e2e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/symfony-util/controller-using-templating-http-foundation)[![Code Coverage](https://camo.githubusercontent.com/0842e9188744b86f215be8b18d1f4f9f39a8bf8a2a7d73616513f335bd0a3eee/68747470733a2f2f696d672e736869656c64732e696f2f636f6465636f762f632f6769746875622f73796d666f6e792d7574696c2f636f6e74726f6c6c65722d7573696e672d74656d706c6174696e672d687474702d666f756e646174696f6e2f6d61737465722e737667)](https://codecov.io/gh/symfony-util/controller-using-templating-http-foundation)[![Scrutinizer](https://camo.githubusercontent.com/f230dd77daf331672b9ec8b880f4d906b827229aa2a427faa0cb75eae427f34b/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f73796d666f6e792d7574696c2f636f6e74726f6c6c65722d7573696e672d74656d706c6174696e672d687474702d666f756e646174696f6e2f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/symfony-util/controller-using-templating-http-foundation/?branch=master)[![SensioLabsInsight](https://camo.githubusercontent.com/85d2fe806872c5382d3a63029117abae771c1168bcaff03413804f22fbfaa2c6/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f62643765666664342d626638632d343164652d383536382d3032323932666364643236322f6d696e692e706e67)](https://insight.sensiolabs.com/projects/bd7effd4-bf8c-41de-8568-02292fcdd262)

### TODO

[](#todo)

- Test more than one Symfony version!

### EngineAsArgumentController

[](#engineasargumentcontroller)

- Uses Engine as controller argument for easier configuration with Symfony 3.3
- Because Twig was not found in autoconfig as a constructor argument
-
- constructor tested only with default value

#### Composer configuration for use in Symfony Framework or elsewhere where this controller is called by the Symfony kernel

[](#composer-configuration-for-use-in-symfony-framework-or-elsewhere-where-this-controller-is-called-by-the-symfony-kernel)

- as long as there is the tiniest risk that Symfony &lt; 3.3 could be installed by composer
- ie Symfony 2.8 is supported until close to the end of 2018 it will survive up to mid 2019 and more in distributions like Debian
-

```
$ composer req symfony-util/controller-using-templating-http-foundation-http-kernel
```

otherwise just

```
$ composer req symfony-util/controller-using-templating-http-foundation
```

#### Symfony configuration (kernel with MicroKernelTrait from symfony/framework)

[](#symfony-configuration-kernel-with-microkerneltrait-from-symfonyframework)

##### symfony/routing

[](#symfonyrouting)

```
function configureRoutes(RouteCollectionBuilder $routes)
{
    // ...
    $routes->add('/', SymfonyUtil\Controller\EngineAsArgumentController::class, 'index');
    // ...
}
```

##### symfony/dependency-injection

[](#symfonydependency-injection)

```
protected function configureContainer(ContainerBuilder $c, LoaderInterface $loader)
{
    // ...
    $c->autowire(SymfonyUtil\Controller\EngineAsArgumentController::class)
        ->setAutoconfigured(true)
        ->addTag('controller.service_arguments')
        ->setPublic(false);
    // ...
```

Icon: [https://material.io/icons/#ic\_wallpaper](https://material.io/icons/#ic_wallpaper)

### TODO

[](#todo-1)

#### PHP 7

[](#php-7)

##### *string* arguments

[](#string-arguments)

- string arguments can officially be type-hinted from php 7.0
-

##### Why code in scripts directory in 5.3 and 5.4 branches is not included in ^7?

[](#why-code-in-scripts-directory-in-53-and-54-branches-is-not-included-in-7)

### Versions

[](#versions)

#### PHP

[](#php)

##### 5.5 TemplatingController::class in unit tests

[](#55-templatingcontrollerclass-in-unit-tests)

##### 5.6 \_\_invoke(...$arguments) in VariadicController.php

[](#56-__invokearguments-in-variadiccontrollerphp)

##### 7.0 (master)

[](#70-master)

- declare(strict\_types=1);
- function f(): float
- function s(string $s)

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance44

Moderate activity, may be stable

Popularity14

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 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 ~229 days

Total

2

Last Release

2802d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/05418642e4b97eda77801e6fa51d18b720e652efcb4aef2e06342e7cf18b6a8a?d=identicon)[Nardberjean](/maintainers/Nardberjean)

---

Top Contributors

[![Nardberjean](https://avatars.githubusercontent.com/u/274837?v=4)](https://github.com/Nardberjean "Nardberjean (212 commits)")

---

Tags

symfonycontrollersnowyowl

### Embed Badge

![Health badge](/badges/symfony-util-controller-using-templating-http-foundation/health.svg)

```
[![Health](https://phpackages.com/badges/symfony-util-controller-using-templating-http-foundation/health.svg)](https://phpackages.com/packages/symfony-util-controller-using-templating-http-foundation)
```

###  Alternatives

[api-platform/core

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

2.6k50.1M314](/packages/api-platform-core)[moonshine/moonshine

Laravel administration panel

1.3k239.9k76](/packages/moonshine-moonshine)[ec-cube/ec-cube

EC-CUBE EC open platform.

78727.2k1](/packages/ec-cube-ec-cube)[mati365/ckeditor5-symfony

CKEditor 5 integration for Symfony

261.9k](/packages/mati365-ckeditor5-symfony)[chameleon-system/chameleon-base

The Chameleon System core.

1027.9k4](/packages/chameleon-system-chameleon-base)

PHPackages © 2026

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