PHPackages                             caffeina-core/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. caffeina-core/twig

ActiveCore-bundle[Templating &amp; Views](/categories/templating)

caffeina-core/twig
==================

Twig service for Caffeina Core Views

1.2.0(10y ago)15.3k1MITPHPPHP &gt;=5.4

Since Nov 18Pushed 9y ago2 watchersCompare

[ Source](https://github.com/caffeina-core/twig)[ Packagist](https://packagist.org/packages/caffeina-core/twig)[ Docs](http://labs.caffeina.co/tech/core)[ RSS](/packages/caffeina-core-twig/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (2)Versions (7)Used By (1)

Core – Twig View
================

[](#core--twig-view)

[![Scrutinizer Code Quality](https://camo.githubusercontent.com/f3c97723326037031134a9f852b8e13a8b89d0aff3cd0d7970514ee88101c796/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6361666665696e612d636f72652f747769672f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/caffeina-core/twig/?branch=master)[![Build Status](https://camo.githubusercontent.com/fce5bc8c497ba45d14a1730616fd379144ba06b9d2638f5b8e04204472f3b9a1/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f6361666665696e612d636f72652f747769672f6261646765732f6275696c642e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/caffeina-core/twig/build-status/master)[![Total Downloads](https://camo.githubusercontent.com/9e9c7f39f9ca57b0d178a67e495920afadf07c5e4fde7e52b6db4dbb15809ac8/68747470733a2f2f706f7365722e707567782e6f72672f6361666665696e612d636f72652f747769672f646f776e6c6f6164732e737667)](https://packagist.org/packages/caffeina-core/twig)[![Latest Stable Version](https://camo.githubusercontent.com/086db48adff766562b9c69eea815fb8516e1caeb1d6c765e8a1a57fe7655fdee/68747470733a2f2f706f7365722e707567782e6f72672f6361666665696e612d636f72652f747769672f762f737461626c652e737667)](https://packagist.org/packages/caffeina-core/twig)[![Latest Unstable Version](https://camo.githubusercontent.com/a47d66e323a09ddfa7cd3ddf2752a59b219fe0f0fcb70547b404e75eb6d0932a/68747470733a2f2f706f7365722e707567782e6f72672f6361666665696e612d636f72652f747769672f762f756e737461626c652e737667)](https://packagist.org/packages/caffeina-core/twig)[![License](https://camo.githubusercontent.com/8f3ca9085eb5d92ce4ee2713729388800eef7a24db88c0b55eeb3d5f5cdd2d49/68747470733a2f2f706f7365722e707567782e6f72672f6361666665696e612d636f72652f747769672f6c6963656e73652e737667)](https://packagist.org/packages/caffeina-core/twig)

[Twig](http://twig.sensiolabs.org) bridge for [Core](https://github.com/caffeina-core/core) View.

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

[](#installation)

Install via [composer](https://getcomposer.org/download/):

```
$ composer require caffeina-core/twig -o
```

Twig
----

[](#twig)

[Twig](http://twig.sensiolabs.org) documentation :

Twig Core\\View Extras
----------------------

[](#twig-coreview-extras)

### Adding a Twig Filter

[](#adding-a-twig-filter)

```
View::addFilter('rot13',function($text){
  return str_rot13($text);
});
```

```
test = {{ test|rot13 }}
```

Outputs :

```
test = grfg
```

### Adding global constants

[](#adding-global-constants)

```
View::addGlobals([
  'BASE_URL'     => '/site/',
  'ASSETS_URL'   => '/site/assets/',
]);
```

```

```

### Adding a Twig Function

[](#adding-a-twig-function)

```
View::addFunction('myFunction',function($a,$b,$c){
  return $a + $b + $c;
});
```

```
Value = {{ myFunction(1,2,3) }}
```

Outputs :

```
Value = 6
```

###  Health Score

31

—

LowBetter than 66% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 97% 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 ~166 days

Total

4

Last Release

3745d ago

### Community

Maintainers

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

---

Top Contributors

[![lastguest](https://avatars.githubusercontent.com/u/178900?v=4)](https://github.com/lastguest "lastguest (32 commits)")[![gadiener](https://avatars.githubusercontent.com/u/8479033?v=4)](https://github.com/gadiener "gadiener (1 commits)")

---

Tags

twigcoreview

### Embed Badge

![Health badge](/badges/caffeina-core-twig/health.svg)

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

###  Alternatives

[symfony/ux-twig-component

Twig components for Symfony

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

Live components for Symfony

1647.0M127](/packages/symfony-ux-live-component)[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)

PHPackages © 2026

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