PHPackages                             devuri/twigit - 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. devuri/twigit

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

devuri/twigit
=============

Twig integration library

v0.1.8(1y ago)1984[1 PRs](https://github.com/devuri/twigit/pulls)2MITPHPPHP ^7.4 || ^8.0CI passing

Since Dec 26Pushed 6mo ago1 watchersCompare

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

READMEChangelog (6)Dependencies (14)Versions (9)Used By (2)

### A Streamlined Templating Approach

[](#a-streamlined-templating-approach)

Modern development increasingly leans toward mono repo architectures that centralize application code, dependencies, and templates in a unified repository. This approach simplifies collaboration, version control, and deployment—making it ideal for large-scale and maintainable web projects.

> Embrace the Hybrid CMS:
>
> [A hybrid-cms approach](https://github.com/devuri/twigit/blob/main/docs/why.md) allows you to keep WordPress’ as your back end while bypassing the default theme system in favor of a templating engine like Twig.

### 1. Install Twigit via Composer

[](#1-install-twigit-via-composer)

In your project root (`mysite`), install Twigit using Composer:

```
composer require devuri/twigit
```

This installs Twigit and Twig in the `vendor` directory.

### 2. Configure Twigit to Use the `templates` Directory

[](#2-configure-twigit-to-use-the-templates-directory)

Twigit can be configured via an mu-plugin or programmatically to locate templates in `mysite/templates`. For example:

```
// Recommended to define constants upstream for flexibility.
if (\defined('USE_TWIGIT') && true === \constant('USE_TWIGIT')) {
    $twig = Twigit\Twigit::init('path/to/mysite', ['autoescape' => 'html']);

    // Apply a template filter that overrides traditional theme handling.
    $twig->templateFilter();
}
```

> If using Raydium, many configuration steps are already handled. Learn more here: [Raydium GitHub Repository](https://github.com/devuri/raydium).

### 3. Organize Your Templates

[](#3-organize-your-templates)

Create a `templates` directory in your project root:

```
mysite/
└── templates/
    ├── base.twig
    ├── header.twig
    └── footer.twig

```

You can copy and adapt Twigit's base templates from its GitHub repository: [Twigit Base Templates](https://github.com/devuri/twigit/tree/main/src/templates)

### 4. Example Twig Template

[](#4-example-twig-template)

Here’s a simple example of a base Twig template:

```

    {{ title }}

    {% block content %}
    {% endblock %}

```

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance57

Moderate activity, may be stable

Popularity18

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 Bus Factor1

Top contributor holds 88% 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 ~2 days

Total

7

Last Release

498d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8fd19f958b007ec6588d0a5ca2fe78e107edd652f286b836d36b5d1781d573a5?d=identicon)[devuri](/maintainers/devuri)

---

Top Contributors

[![devuri](https://avatars.githubusercontent.com/u/4777400?v=4)](https://github.com/devuri "devuri (44 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (6 commits)")

---

Tags

twigwordpresswordpress-theme

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan, Psalm

Type Coverage Yes

### Embed Badge

![Health badge](/badges/devuri-twigit/health.svg)

```
[![Health](https://phpackages.com/badges/devuri-twigit/health.svg)](https://phpackages.com/packages/devuri-twigit)
```

###  Alternatives

[twig/twig

Twig, the flexible, fast, and secure template language for PHP

8.4k443.2M5.8k](/packages/twig-twig)[twig/cssinliner-extra

A Twig extension to allow inlining CSS

22918.5M55](/packages/twig-cssinliner-extra)[symfony/ux-twig-component

Twig components for Symfony

21914.8M162](/packages/symfony-ux-twig-component)[twig/inky-extra

A Twig extension for the inky email templating engine

16612.5M47](/packages/twig-inky-extra)[sulu/sulu

Core framework that implements the functionality of the Sulu content management system

1.3k1.3M152](/packages/sulu-sulu)[twig/markdown-extra

A Twig extension for Markdown

12114.3M83](/packages/twig-markdown-extra)

PHPackages © 2026

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