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

ActiveXaraya-module[Templating &amp; Views](/categories/templating)

xaraya/twig
===========

Use Twig template engine with Xaraya

2.9.4(5mo ago)0661GPL-2.0-or-laterTwig

Since Mar 29Pushed 5mo ago2 watchersCompare

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

READMEChangelogDependencies (1)Versions (21)Used By (1)

Use Twig template engine with Xaraya
====================================

[](#use-twig-template-engine-with-xaraya)

Xaraya has been using Blocklayout for templates since the early days. The [Twig bridge](https://github.com/xaraya/core/blob/com.xaraya.core.bermuda/html/lib/xaraya/bridge/README.md#twig-template-engine) included in Xaraya core allows you to use Twig-based templates to generate output in Xaraya if needed, with a number of Xaraya-specific extensions.

This repository contains the Twig templates converted from Blocklayout for different modules, blocks, properties and themes.

Twig Namespaces
---------------

[](#twig-namespaces)

In general `modules` templates are mapped to their equivalent `@modname` namespace. To avoid overlap (with the themes or blocks modules), `themes`, `properties` and `blocks` templates use the singular equivalent `@theme`, `@property` and `@block` namespace.

ComponentNamespaceTemplatesModule@basehtml/code/modules/baseModule@dynamicdatahtml/code/modules/dynamicdataModule......Theme@themehtml/themesProperty@propertyhtml/code/propertiesBlock@blockhtml/code/blocksXaraya Twig Extensions
----------------------

[](#xaraya-twig-extensions)

Since Blocklayout allows significant PHP processing in templates and Twig deliberately does not, many of the common API calls to static core methods have been made available as Twig functions. Similarly, most Blocklayout and Xaraya tags have their equivalent Twig functions too.

This made translation of all templates from Blocklayout to Twig feasible, but for future template development we highly recommend to prepare all needed template variables up-front in the PHP functions, and then pass them along to the template as intended.

###  Health Score

37

—

LowBetter than 83% of packages

Maintenance73

Regular maintenance activity

Popularity8

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

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

Recently: every ~8 days

Total

20

Last Release

153d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1447115?v=4)[Mike's Pub](/maintainers/mikespub)[@mikespub](https://github.com/mikespub)

---

Top Contributors

[![mikespub](https://avatars.githubusercontent.com/u/1447115?v=4)](https://github.com/mikespub "mikespub (73 commits)")

### Embed Badge

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

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

###  Alternatives

[twig/extra-bundle

A Symfony bundle for extra Twig extensions

91292.0M315](/packages/twig-extra-bundle)[twig/intl-extra

A Twig extension for Intl

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

Adds the power of Twig to Laravel

9105.9M50](/packages/rcrowe-twigbridge)[twig/string-extra

A Twig extension for Symfony String

21946.0M133](/packages/twig-string-extra)[twig/cssinliner-extra

A Twig extension to allow inlining CSS

23018.5M55](/packages/twig-cssinliner-extra)[symfony/ux-twig-component

Twig components for Symfony

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

PHPackages © 2026

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