PHPackages                             vintagesucks/twig-renderer - 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. vintagesucks/twig-renderer

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

vintagesucks/twig-renderer
==========================

Twig 3.x for Yii 1.x

v3.0.2(3y ago)1123.6k↑34.9%1[2 PRs](https://github.com/vintagesucks/twig-renderer/pulls)1BSD-3-ClausePHPCI passing

Since Aug 16Pushed 1mo ago1 watchersCompare

[ Source](https://github.com/vintagesucks/twig-renderer)[ Packagist](https://packagist.org/packages/vintagesucks/twig-renderer)[ Docs](https://github.com/vintagesucks/twig-renderer)[ RSS](/packages/vintagesucks-twig-renderer/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (5)Dependencies (2)Versions (8)Used By (1)

Twig view renderer
==================

[](#twig-view-renderer)

[![Build Status](https://github.com/vintagesucks/twig-renderer/workflows/Build/badge.svg)](https://github.com/vintagesucks/twig-renderer/actions) [![Dependabot](https://camo.githubusercontent.com/16df3a8a95ca528ccfb2013d513815a2b17031dee04bdd555570d256a630ccbc/68747470733a2f2f62616467656e2e6e65742f62616467652f446570656e6461626f742f656e61626c65642f677265656e3f69636f6e3d646570656e6461626f74)](https://dependabot.com/) [![Packagist](https://camo.githubusercontent.com/0b5bf80a83c70725e59843e46df0a35376b025936012f8f19a0b5ee3f538a3b2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f76696e746167657375636b732f747769672d72656e64657265722e737667)](https://packagist.org/packages/vintagesucks/twig-renderer) [![Packagist](https://camo.githubusercontent.com/e491f35c7e92077ad4250880c9b31ede3b1b4f556a616f092399989ef18a8ad6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f76696e746167657375636b732f747769672d72656e64657265722e737667)](https://packagist.org/packages/vintagesucks/twig-renderer)

This extension allows you to use [Twig 3.x](https://twig.symfony.com/) templates in Yii 1

Requirements
------------

[](#requirements)

- Yii 1.1 or above
- PHP 7.2 or above

Installing
----------

[](#installing)

- Install via Composer:

```
composer require vintagesucks/twig-renderer
```

- Add the following to your config file 'components' section:

```
'viewRenderer' => [
    'class' => 'root.vendor.vintagesucks.twig-renderer.ETwigViewRenderer',
    'twigPathAlias' => 'root.vendor.twig.twig.lib.Twig',
    'fileExtension' => '.twig',
],
```

Usage
-----

[](#usage)

- See [Twig syntax](https://twig.symfony.com/doc/3.x/templates.html)
- Current controller properties are accessible via `{{ this.pageTitle }}`
- `Yii::app()` object is accessible via `{{ App }}` (Example: `{{ App.name }}`)
- Yii's core static classes (CHtml, for example) are accessible via `{{ C.ClassNameWithoutFirstC.Method }}` (Example: `{{ C.Html.textField(name,'value') }}`)
- To call functions or methods which return non-string results wrap these calls in a `void` function: `{{ void(App.clientScript.registerScriptFile(...)) }}`

Development
-----------

[](#development)

Run test matrix locally with [`act`](https://github.com/nektos/act):

```
act --job build \
  --workflows .github/workflows/build.yml \
  --platform ubuntu-latest=shivammathur/node:latest \
  --container-architecture linux/amd64
```

###  Health Score

49

—

FairBetter than 95% of packages

Maintenance60

Regular maintenance activity

Popularity35

Limited adoption so far

Community22

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor2

2 contributors hold 50%+ of commits

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

Total

5

Last Release

1207d ago

Major Versions

v2.1.0 → v3.0.02020-02-23

### Community

Maintainers

![](https://www.gravatar.com/avatar/643c795d3ea20f61a3321a6d7d036cdf0a5a1d635f6adc0b4e2e202a552c3c5b?d=identicon)[vintagesucks](/maintainers/vintagesucks)

---

Top Contributors

[![vintagesucks](https://avatars.githubusercontent.com/u/13335308?v=4)](https://github.com/vintagesucks "vintagesucks (31 commits)")[![samdark](https://avatars.githubusercontent.com/u/47294?v=4)](https://github.com/samdark "samdark (21 commits)")[![cebe](https://avatars.githubusercontent.com/u/189796?v=4)](https://github.com/cebe "cebe (9 commits)")[![stansidel](https://avatars.githubusercontent.com/u/904478?v=4)](https://github.com/stansidel "stansidel (6 commits)")[![svyatov](https://avatars.githubusercontent.com/u/310043?v=4)](https://github.com/svyatov "svyatov (6 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (5 commits)")[![dependabot-preview[bot]](https://avatars.githubusercontent.com/in/2141?v=4)](https://github.com/dependabot-preview[bot] "dependabot-preview[bot] (2 commits)")[![resurtm](https://avatars.githubusercontent.com/u/100198?v=4)](https://github.com/resurtm "resurtm (1 commits)")[![vaseninm](https://avatars.githubusercontent.com/u/1026491?v=4)](https://github.com/vaseninm "vaseninm (1 commits)")[![lapiudevgit](https://avatars.githubusercontent.com/u/114943459?v=4)](https://github.com/lapiudevgit "lapiudevgit (1 commits)")[![creocoder](https://avatars.githubusercontent.com/u/896494?v=4)](https://github.com/creocoder "creocoder (1 commits)")[![defro](https://avatars.githubusercontent.com/u/25364?v=4)](https://github.com/defro "defro (1 commits)")[![dmitrivereshchagin](https://avatars.githubusercontent.com/u/14558877?v=4)](https://github.com/dmitrivereshchagin "dmitrivereshchagin (1 commits)")[![gqueiros](https://avatars.githubusercontent.com/u/6408953?v=4)](https://github.com/gqueiros "gqueiros (1 commits)")[![ArtyomNorin](https://avatars.githubusercontent.com/u/18630464?v=4)](https://github.com/ArtyomNorin "ArtyomNorin (1 commits)")[![Outsidaz](https://avatars.githubusercontent.com/u/9278929?v=4)](https://github.com/Outsidaz "Outsidaz (1 commits)")

---

Tags

twigyiitwigextensionyiirenderer

### Embed Badge

![Health badge](/badges/vintagesucks-twig-renderer/health.svg)

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

###  Alternatives

[shoot/shoot

Shoot aims to make providing data to your templates more manageable

40229.9k2](/packages/shoot-shoot)[redant/twig-components

Define reusable components in Twig.

3819.8k1](/packages/redant-twig-components)

PHPackages © 2026

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