Download the PHP package sympress/twig-bundle without Composer
On this page you can find all versions of the php package sympress/twig-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download sympress/twig-bundle
More information about sympress/twig-bundle
Files in sympress/twig-bundle
Package twig-bundle
Short Description Twig integration bundle for SymPress with Symfony TwigBundle feature parity.
License GPL-2.0-or-later
Informations about the package twig-bundle
SymPress TwigBundle
sympress/twig-bundle integrates Twig into the SymPress kernel while delegating the
core feature set to Symfony's symfony/twig-bundle.
Installation
The bundle is discovered by the SymPress kernel through the package metadata in
composer.json. It requires PHP 8.5, SymPress Kernel, SymPress FrameworkBundle,
Symfony TwigBundle, and Twig 3.
Features
- Symfony TwigBundle compiler passes and service definitions
- Symfony Twig configuration under the
twigextension alias - Template lookup in project
templates/, bundleResources/views, and bundletemplates - Autoconfiguration for Twig extensions, loaders, runtimes, and Twig attributes
- Injectable
TemplateRendererInterface - Optional SymPress API for service-backed Twig globals
Configuration
Twig configuration uses Symfony's standard twig extension alias:
The bundle loads its own service wiring from Resources/config/services.yaml and
keeps Symfony TwigBundle service definitions intact. Project services can keep using
normal Twig extension, loader, runtime, and attribute APIs.
Twig Extensions
Services implementing Twig's extension, loader, or runtime interfaces are autoconfigured the same way as in Symfony:
Twig attributes from twig/twig are supported as well:
Twig Globals
Services can provide several globals by implementing GlobalProviderInterface:
For one service-backed global, tag a service class with AsTwigGlobal:
Rendering
Inject SymPress\TwigBundle\Renderer\TemplateRendererInterface when a service
needs view rendering without extending a controller base class.
Controllers can use TwigResponseTrait when they need a Symfony Response from
a Twig template without coupling to a concrete renderer implementation.
Quality Checks
The QA command runs PHPCS, PHPStan, and PHPUnit with the package configuration used by the GitHub Actions workflow.
All versions of twig-bundle with dependencies
symfony/config Version ^8.0
symfony/dependency-injection Version ^8.0
symfony/http-foundation Version ^8.1
symfony/http-kernel Version ^8.1
symfony/twig-bridge Version ^8.1
symfony/twig-bundle Version ^8.1
sympress/framework-bundle Version dev-main
sympress/kernel Version dev-main
twig/twig Version ^3.22