PHPackages                             devtronic/twig-compose - 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. devtronic/twig-compose

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

devtronic/twig-compose
======================

Compose twig templates from multiple child templates

v1.2.2(7y ago)115MITPHPPHP ^5.6 || ^7.0CI failing

Since Jan 17Pushed 6y ago1 watchersCompare

[ Source](https://github.com/devtronic/twig-compose)[ Packagist](https://packagist.org/packages/devtronic/twig-compose)[ RSS](/packages/devtronic-twig-compose/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (5)Dependencies (2)Versions (6)Used By (0)

✨ Twig Compose Environment ✨
============================

[](#-twig-compose-environment-)

A twig extension to compose templates from multiple child templates.

❓ What does this?
-----------------

[](#-what-does-this)

For example you've a base template and N child template which can modify the base Template. If the templates are fixed, there is no problem you can extend from each other. Is the number of templates dynamic you can't use extend. In that case you can use this bundle. Simply call the compose method, pass a base template and a array of sub-templates... and wibbly wobbly you've a template which contains every content of every child template 🌠

📦 Installation
--------------

[](#-installation)

```
$ composer require devtronic/twig-compose
```

❤ Sponsors
----------

[](#-sponsors)

No sponsors at the moment. [Become a sponsor](https://github.com/sponsors/devtronic)

🛠 Usage
-------

[](#-usage)

For details take a look in the tests directory

### ➡ With a your existing Twig\_Environment

[](#-with-a-your-existing-twig_environment)

```
