PHPackages                             weew/app-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. [Templating &amp; Views](/categories/templating)
4. /
5. weew/app-twig

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

weew/app-twig
=============

Twig integration for the weew/app package.

v1.2.1(9y ago)0781MITPHP

Since Apr 1Pushed 9y ago1 watchersCompare

[ Source](https://github.com/weew/app-twig)[ Packagist](https://packagist.org/packages/weew/app-twig)[ RSS](/packages/weew-app-twig/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (6)Versions (5)Used By (1)

App twig provider
=================

[](#app-twig-provider)

[![Build Status](https://camo.githubusercontent.com/3e49ee635d31cc8760f1effb4a86e7590316ed529cf89562e48bde0e464d2ab4/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f776565772f6170702d747769672e737667)](https://travis-ci.org/weew/app-twig)[![Code Quality](https://camo.githubusercontent.com/e4d04e4269e84f0cd82ee11c2e26058b60b2fb8c45d90989982b6bab7263146e/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f776565772f6170702d747769672e737667)](https://scrutinizer-ci.com/g/weew/app-twig)[![Test Coverage](https://camo.githubusercontent.com/408dedd21e59b0283d8273144bffb8ad2e0215cb3504a8d0786555ede6116799/68747470733a2f2f696d672e736869656c64732e696f2f636f766572616c6c732f776565772f6170702d747769672e737667)](https://coveralls.io/github/weew/app-twig)[![Version](https://camo.githubusercontent.com/96702cb8fff35a32f82b5b18f6662693c2b87b1a4a703c3f70736e4cf749824c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f776565772f6170702d747769672e737667)](https://packagist.org/packages/weew/app-twig)[![Licence](https://camo.githubusercontent.com/c338418d8bb0b9af1ad265fdd2008379f2d41c9ab0a36f0b3d59b9060ca805ac/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f776565772f6170702d747769672e737667)](https://packagist.org/packages/weew/app-twig)

Table of contents
-----------------

[](#table-of-contents)

- [Installation](#installation)
- [Introduction](#introduction)
- [Usage](#usage)
- [Example config](#example-config)
- [Doctrine console](#twig-console)

Installation
------------

[](#installation)

`composer require weew/app-twig`

Introduction
------------

[](#introduction)

This package integrates [twig/twig](https://github.com/twigphp/Twig) into the [weew/app](https://github.com/weew/app) framework.

Usage
-----

[](#usage)

Simply register the `TwigProvider` class on the application kernel:

```
$app = new App();
$app->getKernel()->addProviders([
    TwigProvider::class,
]);
```

Example config
--------------

[](#example-config)

This is how your config *might* look like in yaml:

```
twig:
  debug: true
  charset: utf-8
  base_template_class: SomeClass
  cache: /cache/path
  auto_reload: true
  auto_escape: true
  strict_variables: false
  optimizations: -1

  paths:
    - /path/to/views
    - /another/path/to/views

  namespaces:
    namespace: /path/to/namespaced/views
    another_namespace: /another/path/to/namespaced/views
```

The only required setting is `twig.debug`, all the other are optional and should be used when needed. Fur further information about twig configuration please take a look at twig [documentation](http://twig.sensiolabs.org/doc/api.html#environment-options).

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity66

Established project with proven stability

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 ~37 days

Total

4

Last Release

3632d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/10b2b854b5829dd13a15967c000ed2119b5faef67aca24d94c653c8ac550d85e?d=identicon)[weew](/maintainers/weew)

### Embed Badge

![Health badge](/badges/weew-app-twig/health.svg)

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

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M2.9k](/packages/craftcms-cms)[symfony/ux-twig-component

Twig components for Symfony

22018.6M322](/packages/symfony-ux-twig-component)[symfony/ux-live-component

Live components for Symfony

1647.0M117](/packages/symfony-ux-live-component)

PHPackages © 2026

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