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

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

wyrihaximus/react-http-middleware-twig
======================================

ReactPHP HTTP Twig Middleware

2.0.0(5y ago)54233[5 PRs](https://github.com/WyriHaximus/reactphp-http-middleware-twig/pulls)MITPHPPHP ^7.3

Since Nov 24Pushed 7mo ago2 watchersCompare

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

READMEChangelog (2)Dependencies (5)Versions (9)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

36

—

LowBetter than 82% of packages

Maintenance43

Moderate activity, may be stable

Popularity19

Limited adoption so far

Community16

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 78.4% 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 ~190 days

Total

2

Last Release

2167d ago

Major Versions

1.0.0 → 2.0.02020-06-02

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/147145?v=4)[Cees-Jan Kiewiet](/maintainers/WyriHaximus)[@WyriHaximus](https://github.com/WyriHaximus)

---

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)")[![faabiopontes](https://avatars.githubusercontent.com/u/2223935?v=4)](https://github.com/faabiopontes "faabiopontes (1 commits)")

---

Tags

hacktoberfest

### Embed Badge

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

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

###  Alternatives

[league/uri-interfaces

Common tools for parsing and resolving RFC3987/RFC3986 URI

538204.9M23](/packages/league-uri-interfaces)[spiral/roadrunner-http

RoadRunner: HTTP and PSR-7 worker

779.2M48](/packages/spiral-roadrunner-http)[phpro/http-tools

HTTP tools for developing more consistent HTTP implementations.

28137.8k](/packages/phpro-http-tools)[mezzio/mezzio-authentication-oauth2

OAuth2 (server) authentication middleware for Mezzio and PSR-7 applications.

28483.0k2](/packages/mezzio-mezzio-authentication-oauth2)[openswoole/core

Openswoole core library

181.1M32](/packages/openswoole-core)[mimmi20/browser-detector

Library to detect Browsers and Devices

48153.5k3](/packages/mimmi20-browser-detector)

PHPackages © 2026

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