PHPackages                             htmlburger/wpemerge-twig - 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. [Framework](/categories/framework)
4. /
5. htmlburger/wpemerge-twig

ActiveLibrary[Framework](/categories/framework)

htmlburger/wpemerge-twig
========================

Enables the use of Twig views in WP Emerge.

0.16.0(5y ago)83313GPL-2.0-onlyPHPPHP ^7.0

Since Feb 11Pushed 5y ago4 watchersCompare

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

READMEChangelog (4)Dependencies (2)Versions (8)Used By (0)

WP Emerge Twig
==============

[](#wp-emerge-twig)

Enables the use of Twig views in [WP Emerge](https://github.com/htmlburger/wpemerge).

Quickstart
----------

[](#quickstart)

1. Run `composer require htmlburger/wpemerge-twig` in your theme directory
2. Add `\WPEmergeTwig\View\ServiceProvider` to your array of providers when booting WPEmerge: ```
    \App::make()->bootstrap( [
        'providers' => [
            \WPEmergeTwig\View\ServiceProvider::class,
        ],
    ] );
    ```

Options
-------

[](#options)

Default options:

```
[
    // Automatically replace the default view engine for WP Emerge.
    'replace_default_engine' => true,

    // Pass .php views to the default view engine.
    // replace_default_engine must be true for this to take effect.
    'proxy_php_views' => true,

    // One or more directories to search for views.
    // Defaults to the main ['views'] key of the configuration.
    'views' => [get_stylesheet_directory(), get_template_directory()],

    // Options passed directly to Twig.
    'options' => [
        // 'cache' defaults to the main ['cache']['path'] key of the configuration.
        'cache' => 'wp-content/uploads/wpemerge/cache/twig',
    ],
]
```

You can change these options by specifying a `twig` key in your WP Emerge config array:

```
\App::make()->bootstrap( [
    // ... other WP Emerge options
    'twig' => [
        // ... other WP Emerge Twig options
        'options' => [
            // ... other Twig options
            'cache' => false,
        ],
    ],
] );
```

More information on what Twig options are supported is available on .

Extending Twig
--------------

[](#extending-twig)

You can use the following to extend twig with a custom filter, for example:

```
$myfilter = new Twig_Filter( 'myfilter', function( $string ) {
    return strtoupper( $string );
} );

// \App::resolve() used for brevity's sake - use a Service Provider instead.
$twig = \App::resolve( WPEMERGETWIG_VIEW_TWIG_VIEW_ENGINE_KEY );
$twig->environment()->addFilter( $myfilter );
```

With this, you now have your very own custom Twig filter:

```
{{ 'hello world!' | myfilter }}
```

More information on how you can extend Twig is available on .

###  Health Score

29

—

LowBetter than 59% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community13

Small or concentrated contributor base

Maturity53

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 98.2% 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 ~138 days

Recently: every ~185 days

Total

7

Last Release

2183d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/336248db7ed8822f03252c68698723130503a82c6d291ff24c7b17edaa3c8226?d=identicon)[atanas.angelov.dev](/maintainers/atanas.angelov.dev)

---

Top Contributors

[![atanas-dev](https://avatars.githubusercontent.com/u/22746396?v=4)](https://github.com/atanas-dev "atanas-dev (54 commits)")[![mickaelperrin](https://avatars.githubusercontent.com/u/5844226?v=4)](https://github.com/mickaelperrin "mickaelperrin (1 commits)")

---

Tags

frameworkwordpresstemplateviewwpemerge

### Embed Badge

![Health badge](/badges/htmlburger-wpemerge-twig/health.svg)

```
[![Health](https://phpackages.com/badges/htmlburger-wpemerge-twig/health.svg)](https://phpackages.com/packages/htmlburger-wpemerge-twig)
```

###  Alternatives

[htmlburger/wpemerge

A micro framework which modernizes WordPress as a CMS development by providing tools to implement MVC and more.

456137.8k8](/packages/htmlburger-wpemerge)[slim/twig-view

Slim Framework 4 view helper built on top of the Twig 3 templating component

3708.0M210](/packages/slim-twig-view)[slim/php-view

Render PHP view scripts into a PSR-7 Response object.

2739.7M95](/packages/slim-php-view)

PHPackages © 2026

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