pieceofcake2 / twig-view
Twig 3 template engine for CakePHP 2 views
Package info
github.com/pieceofcake2/twig-view
Type:cakephp-plugin
pkg:composer/pieceofcake2/twig-view
Requires
- php: >=8.1
- composer/installers: ^1.0 || ^2.0
- pieceofcake2/cakephp: ^2.12
- twig/twig: ^3.21
Requires (Dev)
- phpstan/phpstan: ^2.1
- phpunit/phpunit: ^9.6
- pieceofcake2/app: ^2.2
- pieceofcake2/phpcs-cakephp2: ^1.1
- pieceofcake2/phpstan-cakephp2: ^1.0
Suggests
None
Provides
None
Conflicts
None
Replaces
- wyrihaximus/twig-view: ^1.0
This package is auto-updated.
Last update: 2026-10-16 09:35:05 UTC
README
pieceofcake2/twig-view integrates the Twig Templating Language (Twig 3.x) with CakePHP 2, providing access to helpers, elements and themes from Twig templates. It is a modernized fork of predominant/TwigView with PSR-4 namespaces and PHP 8.1+ support.
Note
For CakePHP 5.x, use the official cakephp/twig-view package instead.
Documentation
- Website: https://pieceofcake2.github.io/twig-view/ (日本語: https://pieceofcake2.github.io/twig-view/ja/)
- Markdown: docs/README.md (日本語: docs/ja/README.md) (for AI tools and offline reading)
The Markdown documentation is also included in the Composer package, in the plugin's directory: plugins/TwigView/docs/README.md (the location depends on your installer-paths). Install the package with --dev if you only need it for development.
Requirements
- PHP 8.1+
- pieceofcake2/cakephp 2.12+
- Twig 3.x
Installation
composer require pieceofcake2/twig-view
Then load the plugin and set TwigView.Twig as the view class.
See Installation and Quick Start.
Contributing
See the contribution guidelines.
Origin
This package is a maintained fork of predominant/TwigView (not published on Packagist, last upstream version v0.6), originally by Kjell Bublitz and Graham Weldon. It is maintained for CakePHP 2 on modern PHP by pieceofcake2. Changes from the original are listed in CHANGELOG.md.
License
MIT License. See LICENSE.