PHPackages                             zhangzhaosen/yii2-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. zhangzhaosen/yii2-twig

ActiveYii2-extension[Templating &amp; Views](/categories/templating)

zhangzhaosen/yii2-twig
======================

The Twig integration for the Yii framework

1.0.1(8y ago)02BSD-3-ClausePHP

Since Sep 26Pushed 8y ago1 watchersCompare

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

READMEChangelog (2)Dependencies (2)Versions (3)Used By (0)

 [ ![](https://camo.githubusercontent.com/baea95c9cb6fb1dea300746b392f38db3338f9bc0a5eae0d4a4e06066fd5b66a/68747470733a2f2f747769672e73796d666f6e792e636f6d2f696d616765732f747769672d6c6f676f2e706e67) ](https://twig.symfony.com/)

Twig Extension for Yii 2
========================

[](#twig-extension-for-yii-2)

This extension provides a `ViewRender` that would allow you to use [Twig](http://twig.sensiolabs.org/) view template engine with [Yii framework 2.0](http://www.yiiframework.com).

For license information check the [LICENSE](LICENSE.md)-file.

Documentation is at [docs/guide/README.md](docs/guide/README.md).

[![Latest Stable Version](https://camo.githubusercontent.com/63de3c52b7183a92dcb8d13141e73b81d28e0594d10a20f14b6580016450b2d7/68747470733a2f2f706f7365722e707567782e6f72672f796969736f66742f796969322d747769672f762f737461626c652e706e67)](https://packagist.org/packages/yiisoft/yii2-twig)[![Total Downloads](https://camo.githubusercontent.com/47b9f9b0556392d12a611a190d1b0ce78dfc7ddd99aa6e5cf867d599ced889f8/68747470733a2f2f706f7365722e707567782e6f72672f796969736f66742f796969322d747769672f646f776e6c6f6164732e706e67)](https://packagist.org/packages/yiisoft/yii2-twig)[![Build Status](https://camo.githubusercontent.com/5bc6e03f3d346c09b80b04068a8746a109ed04c0ec7e3521bea38010a31b9e80/68747470733a2f2f7472617669732d63692e6f72672f796969736f66742f796969322d747769672e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/yiisoft/yii2-twig)

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist zhangzhaosen/yii2-twig

```

or add

```
"zhangzhaosen/yii2-twig": "~1.0.0"

```

to the require section of your composer.json.

Usage
-----

[](#usage)

To use this extension, configure it as described in [documentation](docs/guide/installation.md#configuring-application).

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity2

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~0 days

Total

2

Last Release

3152d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/9b9d6c84d31abbfaf7491f4c5b0949675bb8178e13f8b65148d8f3bf7503643d?d=identicon)[zhangzhaosen](/maintainers/zhangzhaosen)

---

Top Contributors

[![zhangzhaosen](https://avatars.githubusercontent.com/u/852952?v=4)](https://github.com/zhangzhaosen "zhangzhaosen (3 commits)")

---

Tags

twigyii2renderer

### Embed Badge

![Health badge](/badges/zhangzhaosen-yii2-twig/health.svg)

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

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M2.6k](/packages/craftcms-cms)[twig/intl-extra

A Twig extension for Intl

36663.2M221](/packages/twig-intl-extra)[twig/string-extra

A Twig extension for Symfony String

21946.0M133](/packages/twig-string-extra)[symfony/ux-twig-component

Twig components for Symfony

21814.8M162](/packages/symfony-ux-twig-component)[yiisoft/yii2-twig

The Twig integration for the Yii framework

1431.9M32](/packages/yiisoft-yii2-twig)[symfony/ux-live-component

Live components for Symfony

1635.6M72](/packages/symfony-ux-live-component)

PHPackages © 2026

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