Download the PHP package jdwx/web-twig without Composer
On this page you can find all versions of the php package jdwx/web-twig. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jdwx/web-twig
More information about jdwx/web-twig
Files in jdwx/web-twig
Package web-twig
Short Description Integrate twig templates with jdwx/web and jdwx/panels.
License MIT
Informations about the package web-twig
jdwx/web-twig
A very thin module for integrating Twig templates into other web-related modules.
Installation
You can require it directly with Composer:
Or download the source from GitHub: https://github.com/jdwx/web-twig.git
Requirements
This module requires PHP 8.3 and Twig 3.0 or later.
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:
Then displaying errors is very straightforward:
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
This module was loosely adapted from an existing codebase in early 2025.
All versions of web-twig with dependencies
jdwx/panels Version dev-main
jdwx/twig Version ^2.0
jdwx/web Version ^3.0
jdwx/web-framework Version ^1.0