PHPackages                             wpjscc/react-http-middleware-twig - 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. wpjscc/react-http-middleware-twig

ActiveLibrary[HTTP &amp; Networking](/categories/http)

wpjscc/react-http-middleware-twig
=================================

ReactPHP HTTP Twig Middleware

v2.0.0(1y ago)05MITPHPPHP ^8 || ^7.4

Since Aug 25Pushed 1y agoCompare

[ Source](https://github.com/wpjscc/reactphp-http-middleware-twig)[ Packagist](https://packagist.org/packages/wpjscc/react-http-middleware-twig)[ GitHub Sponsors](https://github.com/WyriHaximus)[ RSS](/packages/wpjscc-react-http-middleware-twig/feed)WikiDiscussions master Synced yesterday

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

ReactPHP HTTP Twig Middleware
=============================

[](#reactphp-http-twig-middleware)

[![Build Status](https://camo.githubusercontent.com/fab07724234462d2a4cfde1f17a061cf78c4bc2b2cee012e9340d5a4d28333d8/68747470733a2f2f7472617669732d63692e636f6d2f57797269486178696d75732f72656163747068702d687474702d6d6964646c65776172652d747769672e7376673f6272616e63683d6d6173746572)](https://travis-ci.com/WyriHaximus/reactphp-http-middleware-twig)[![Latest Stable Version](https://camo.githubusercontent.com/b8842a7626c8486874cec32352b96cb23c62f7ec2004d9f5167ffba5464e6b9e/68747470733a2f2f706f7365722e707567782e6f72672f57797269486178696d75732f72656163742d687474702d6d6964646c65776172652d747769672f762f737461626c652e706e67)](https://packagist.org/packages/WyriHaximus/react-http-middleware-twig)[![Total Downloads](https://camo.githubusercontent.com/906041c625e08f8d0cf536a1adbd77c8dc3b20f7b816bd6b658b098e62ae5674/68747470733a2f2f706f7365722e707567782e6f72672f57797269486178696d75732f72656163742d687474702d6d6964646c65776172652d747769672f646f776e6c6f6164732e706e67)](https://packagist.org/packages/WyriHaximus/react-http-middleware-twig)[![Code Coverage](https://camo.githubusercontent.com/9d53234e7f194ff5c5a533a9e94e82bc778df985db60e3d368a485a95601e005/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f57797269486178696d75732f72656163747068702d687474702d6d6964646c65776172652d747769672f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/WyriHaximus/reactphp-http-middleware-twig/?branch=master)[![License](https://camo.githubusercontent.com/3b7f1345faf311099c0bb697821fea1ce504e7c276badc972ec96853ca760aa2/68747470733a2f2f706f7365722e707567782e6f72672f57797269486178696d75732f72656163742d687474702d6d6964646c65776172652d747769672f6c6963656e73652e706e67)](https://packagist.org/packages/WyriHaximus/react-http-middleware-twig)[![PHP 7 ready](https://camo.githubusercontent.com/42718cddeb81248571079e9a79343ed0f98fbc659d6f1cf0bbf642e84f6d6cbf/687474703a2f2f7068703772656164792e74696d6573706c696e7465722e63682f57797269486178696d75732f72656163747068702d687474702d6d6964646c65776172652d636c6561722d626f64792f62616467652e737667)](https://travis-ci.org/WyriHaximus/reactphp-http-middleware-clear-body)

Install
=======

[](#install)

To install via [Composer](http://getcomposer.org/), use the command below, it will automatically detect the latest version and bind it with `^`.

```
composer require wyrihaximus/react-http-middleware-twig

```

Usage
=====

[](#usage)

When a `TemplateResponse` is returned as response the `TemplateRenderMiddleware` will render the given template with the given data using the given Twig environment.

```
$server = new Server([
    /** Other middleware */
    new TemplateRenderMiddleware([
        $twigEnvironment
    ]),
    function () {
        return (new TemplateResponse())->withTemplateData([/** Array with the data for the template */])->withTemplate('frontpage')
    }
]);
```

License
=======

[](#license)

The MIT License (MIT)

Copyright (c) 2019 Cees-Jan Kiewiet

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

###  Health Score

23

—

LowBetter than 26% of packages

Maintenance33

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 77.8% 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

Unknown

Total

1

Last Release

677d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/76907477?v=4)[wpjscc](/maintainers/wpjscc)[@wpjscc](https://github.com/wpjscc)

---

Top Contributors

[![WyriHaximus](https://avatars.githubusercontent.com/u/147145?v=4)](https://github.com/WyriHaximus "WyriHaximus (214 commits)")[![dependabot-support](https://avatars.githubusercontent.com/u/112581971?v=4)](https://github.com/dependabot-support "dependabot-support (36 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (14 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (6 commits)")[![dreadwarrior](https://avatars.githubusercontent.com/u/277988?v=4)](https://github.com/dreadwarrior "dreadwarrior (2 commits)")[![wpjscc](https://avatars.githubusercontent.com/u/76907477?v=4)](https://github.com/wpjscc "wpjscc (2 commits)")[![faabiopontes](https://avatars.githubusercontent.com/u/2223935?v=4)](https://github.com/faabiopontes "faabiopontes (1 commits)")

### Embed Badge

![Health badge](/badges/wpjscc-react-http-middleware-twig/health.svg)

```
[![Health](https://phpackages.com/badges/wpjscc-react-http-middleware-twig/health.svg)](https://phpackages.com/packages/wpjscc-react-http-middleware-twig)
```

###  Alternatives

[symfony/symfony

The Symfony PHP framework

31.4k87.2M2.2k](/packages/symfony-symfony)[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

8.0k1.1B4.0k](/packages/guzzlehttp-psr7)[shopware/core

Shopware platform is the core for all Shopware ecommerce products.

585.6M574](/packages/shopware-core)[sproutcms/cms

Enterprise content management and framework

242.5k4](/packages/sproutcms-cms)

PHPackages © 2026

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