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)1166.8k↓17.4%11BSD-3-ClausePHPCI passing

Since Aug 16Pushed 1w 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 2d ago

READMEChangelog (5)Dependencies (2)Versions (10)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

51

—

FairBetter than 95% of packages

Maintenance64

Regular maintenance activity

Popularity36

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity68

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

1253d ago

Major Versions

v2.1.0 → v3.0.02020-02-23

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/13335308?v=4)[Nikolas Evers](/maintainers/vintagesucks)[@vintagesucks](https://github.com/vintagesucks)

---

Top Contributors

[![vintagesucks](https://avatars.githubusercontent.com/u/13335308?v=4)](https://github.com/vintagesucks "vintagesucks (33 commits)")[![samdark](https://avatars.githubusercontent.com/u/47294?v=4)](https://github.com/samdark "samdark (21 commits)")[![dependabot[bot]](https://avatars.githubusercontent.com/in/29110?v=4)](https://github.com/dependabot[bot] "dependabot[bot] (9 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-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

[symfony/ux-twig-component

Twig components for Symfony

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

Live components for Symfony

1647.0M128](/packages/symfony-ux-live-component)[tales-from-a-dev/twig-tailwind-extra

A Twig extension for Tailwind

361.1M13](/packages/tales-from-a-dev-twig-tailwind-extra)[symfony/ux-toolkit

A tool to easily create a design system in your Symfony app with customizable, well-crafted Twig components

16126.1k1](/packages/symfony-ux-toolkit)[mati365/ckeditor5-symfony

CKEditor 5 integration for Symfony

262.6k](/packages/mati365-ckeditor5-symfony)[umanit/twig-image-extension

An extension to facilitate the integration of responsive images' markup in Twig templates.

1044.4k](/packages/umanit-twig-image-extension)

PHPackages © 2026

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