PHPackages                             layershifter/cakephp-twig-view - 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. layershifter/cakephp-twig-view

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

layershifter/cakephp-twig-view
==============================

Twig for CakePHP 1.3

0.10.2(8y ago)05.8kMITPHP

Since Mar 22Pushed 8y ago1 watchersCompare

[ Source](https://github.com/layershifter/cakephp-twig-view)[ Packagist](https://packagist.org/packages/layershifter/cakephp-twig-view)[ Docs](https://github.com/m3nt0r/cakephp-twig-view)[ RSS](/packages/layershifter-cakephp-twig-view/feed)WikiDiscussions master Synced 2mo ago

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

Twig for CakePHP (v0.8.0)
=========================

[](#twig-for-cakephp-v080)

This plugin for the CakePHP Framework allows you to use the Twig, the flexible, fast, and secure template engine for PHP.

Apart from enabling you to use most of Twig's features the plugin is tightly integrated with the CakePHP view renderer giving you full access to helpers, objects and elements.

New in this version
-------------------

[](#new-in-this-version)

- Using Composer for dependency management

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

[](#installation)

#### via Archive

[](#via-archive)

Download the [current version as ZIP](https://github.com/m3nt0r/cakephp-twig-view/zipball/master), unzip it and rename the extracted folder to `twig`. Then put the `twig` folder inside your `plugins` and you are done.

#### via GitHub

[](#via-github)

Just clone the repository directly into your `plugins` folder as `twig`.

```
$ git clone https://github.com/m3nt0r/cakephp-twig-view.git twig

```

Twig Version Support
--------------------

[](#twig-version-support)

This plugin now uses [Composer](https://getcomposer.org/) to manage dependencies. Simply running "composer install" will fetch the required libraries.

Enabling the View
-----------------

[](#enabling-the-view)

Inside your `app_controller.php` add the following:

```
class AppController extends Controller {
    public $view = 'Twig.Twig'; // use twig
}
```

Now start by creating twig templates using the `.tpl` extension.

### Fallback / Upgrading exsiting apps

[](#fallback--upgrading-exsiting-apps)

By default the view will render any existing `.ctp` like always but will prefer the `.tpl` version if present. This means that, for example, the `index.ctp` is used until you create a `index.tpl` at the same location.

That way you can upgrade existing views one at a time instead of having to rework all files at once.

Documentation
-------------

[](#documentation)

Check the [wiki](https://github.com/m3nt0r/cakephp-twig-view/wiki) for more details on features and usage.

Version History
---------------

[](#version-history)

This version was written on **CakePHP 1.3**.

### v0.8

[](#v08)

- Replaced "TWIG\_DIR" method with composer.
- Removed included Twig library
- Minor refactoring

### v0.7.1

[](#v071)

- Added TWIG\_DIR so you can define the full Twig root-directory name
- Deprecated TWIG\_VERSION because it lost its purpose due to this change
- Added fabpot/Twig as a submodule of this git repository

### v0.7

[](#v07)

- Complete rewrite
- Latest Twig (v1.8.3 atm)
- Easy to upgrade
- Easy to install
- Easy to migrate
- Extendable (see wiki)
- More CakePHP Filters

CakePHP 2
---------

[](#cakephp-2)

Support for 2.x may be limited to non-existant. If you run on 2.x i suggest that you check out the [fork of predominant](https://github.com/predominant/TwigView).

License
-------

[](#license)

MIT License
Copyright (c) 2010-2014, Kjell Bublitz.

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity17

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity58

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 91.5% 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 ~4 days

Total

7

Last Release

2946d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/cb35bc820d86cec54b205d2b77dd665b89e06810d667177576239400aa321108?d=identicon)[LayerShifter](/maintainers/LayerShifter)

---

Top Contributors

[![m3nt0r](https://avatars.githubusercontent.com/u/23321?v=4)](https://github.com/m3nt0r "m3nt0r (97 commits)")[![layershifter](https://avatars.githubusercontent.com/u/14183168?v=4)](https://github.com/layershifter "layershifter (8 commits)")[![rewish](https://avatars.githubusercontent.com/u/55593?v=4)](https://github.com/rewish "rewish (1 commits)")

---

Tags

cakephptemplating

### Embed Badge

![Health badge](/badges/layershifter-cakephp-twig-view/health.svg)

```
[![Health](https://phpackages.com/badges/layershifter-cakephp-twig-view/health.svg)](https://phpackages.com/packages/layershifter-cakephp-twig-view)
```

###  Alternatives

[timber/timber

Create WordPress themes with beautiful OOP code and the Twig Template Engine

5.7k3.4M108](/packages/timber-timber)[jasny/twig-extensions

A set of useful Twig filters

10710.2M8](/packages/jasny-twig-extensions)[jms/twig-js

twig.js, flexible, secure, and high-performance templating engine for Javascript

360389.6k5](/packages/jms-twig-js)[wyrihaximus/twig-view

Twig powered View for CakePHP

804.7M1](/packages/wyrihaximus-twig-view)[goetas/twital

PHP templating engine that combines Twig and PHPTal power points

12813.0k1](/packages/goetas-twital)

PHPackages © 2026

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