PHPackages                             jdwx/web-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. [Templating &amp; Views](/categories/templating)
4. /
5. jdwx/web-twig

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

jdwx/web-twig
=============

Integrate twig templates with jdwx/web and jdwx/panels.

v3.0.0(5mo ago)029MITPHPPHP &gt;=8.3.0

Since Jun 8Pushed 5mo agoCompare

[ Source](https://github.com/jdwx/web-twig)[ Packagist](https://packagist.org/packages/jdwx/web-twig)[ RSS](/packages/jdwx-web-twig/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (12)Used By (0)

jdwx/web-twig
=============

[](#jdwxweb-twig)

A very thin module for integrating Twig templates into other web-related modules.

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

[](#installation)

You can require it directly with Composer:

```
composer require jdwx/web-twig
```

Or download the source from GitHub:

Requirements
------------

[](#requirements)

This module requires PHP 8.3 and Twig 3.0 or later.

Usage
-----

[](#usage)

This module provides a simple interface for integrating Twig templates into panels and pages interfaces provided by the jdwx/panels and jdwx/web-php modules. The AbstractPage class can be subclassed to provide values when the template is rendered. The StaticPage class allows values to be provided when the page is instantiated. The MapPage class binds a Map that can be updated at any time.

You can also use subclasses to avoid repetitive code. For example, if you have all of your error page templates in one directory, you can create a subclass like this:

```
class ErrorPage extends StaticPage {

    /** @param array $i_rValues */
    public function __construct( string $name, array $i_rValues = [] ) {
        # Give it the path to your error templates.
        $env = TwigHelper::forDirectory( __DIR__ . '/templates/' );
        parent::__construct( $env, $name, $i_rValues );
    }

    /** @param array $i_rValues */
    public static function get( string $name, array $i_rValues = [] ) : string {
        return ( new self( $name, $i_rValues ) )->render();
    }

}
```

Then displaying errors is very straightforward:

```
echo ErrorPage::get( 'error404', [ 'return_url' => '/' ] ), "\n\n";
```

Stability
---------

[](#stability)

This module is relatively new and has not been extensively deployed in production yet, but the interface should be relatively stable. There's really not a lot to it; this module exists mainly to keep from introducing Twig as a dependency where it's not needed.

History
-------

[](#history)

This module was loosely adapted from an existing codebase in early 2025.

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance70

Regular maintenance activity

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity58

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

Recently: every ~27 days

Total

11

Last Release

172d ago

Major Versions

2.x-dev → v3.0.02025-11-28

### Community

Maintainers

![](https://www.gravatar.com/avatar/f71b4b976170f89eac19be48c7381a27c49ed8c9cb5e8e6ff05a2ad7583efa13?d=identicon)[jdwx](/maintainers/jdwx)

---

Top Contributors

[![jdwx](https://avatars.githubusercontent.com/u/2722779?v=4)](https://github.com/jdwx "jdwx (1 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Type Coverage Yes

### Embed Badge

![Health badge](/badges/jdwx-web-twig/health.svg)

```
[![Health](https://phpackages.com/badges/jdwx-web-twig/health.svg)](https://phpackages.com/packages/jdwx-web-twig)
```

###  Alternatives

[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[whitecube/nova-flexible-content

Flexible Content &amp; Repeater Fields for Laravel Nova.

8053.0M25](/packages/whitecube-nova-flexible-content)[mopa/bootstrap-bundle

Easy integration of twitters bootstrap into symfony2

7042.9M33](/packages/mopa-bootstrap-bundle)[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3871.2M](/packages/limenius-react-bundle)[nicmart/string-template

StringTemplate is a very simple string template engine for php. I've written it to have a thing like sprintf, but with named and nested substutions.

2101.7M30](/packages/nicmart-string-template)[symfony/ux-icons

Renders local and remote SVG icons in your Twig templates.

555.8M69](/packages/symfony-ux-icons)

PHPackages © 2026

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