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

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

maduser/argon-twig
==================

Twig integration for the Argon runtime stack.

v1.0.0(2mo ago)00MITPHPPHP ^8.2CI passing

Since May 25Pushed 2mo agoCompare

[ Source](https://github.com/judus/argon-twig)[ Packagist](https://packagist.org/packages/maduser/argon-twig)[ RSS](/packages/maduser-argon-twig/feed)WikiDiscussions main Synced 1w ago

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

argon-twig
==========

[](#argon-twig)

[![PHP](https://camo.githubusercontent.com/ce3e396e4f1bbbd326f628872a1414656d28065f2712cda0868d8eff07320aec/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d382e322b2d626c7565)](https://www.php.net/)[![Build](https://github.com/judus/argon-twig/actions/workflows/php.yml/badge.svg?branch=main)](https://github.com/judus/argon-twig/actions)[![codecov](https://camo.githubusercontent.com/7a906b3f3c5664b797d3e74c31a31ea707d7d94a3cf32940a8def8c0ed8da571/68747470733a2f2f636f6465636f762e696f2f67682f6a756475732f6172676f6e2d747769672f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/judus/argon-twig)[![Psalm Level](https://camo.githubusercontent.com/a5085fdab283870d5b607324d7ae9cd32e8384064f956ffcd7bdaa52cbce4f5d/68747470733a2f2f73686570686572642e6465762f6769746875622f6a756475732f6172676f6e2d747769672f636f7665726167652e737667)](https://shepherd.dev/github/judus/argon-twig)[![Latest Version](https://camo.githubusercontent.com/aabb458d94f8b017bfbe94cca5f7d8db361b89a5f405de459c8014488f28656c/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d6164757365722f6172676f6e2d747769672e737667)](https://packagist.org/packages/maduser/argon-twig)[![Total Downloads](https://camo.githubusercontent.com/1ef76dc72234517633b52755365d0b8ce1b1db6869760406aa4a3326a30e9dff/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d6164757365722f6172676f6e2d747769672e7376673f636f6c6f723d626c7565)](https://packagist.org/packages/maduser/argon-twig)[![License: MIT](https://camo.githubusercontent.com/fdf2982b9f5d7489dcf44570e714e3a15fce6253e0cc6b5aa61a075aac2ff71b/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c6963656e73652d4d49542d79656c6c6f772e737667)](https://opensource.org/licenses/MIT)

Twig integration for the Argon runtime stack.

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

[](#installation)

```
composer require maduser/argon-twig
```

Registration
------------

[](#registration)

Register the service provider in your application composition layer:

```
use Maduser\Argon\Twig\Provider\TwigServiceProvider;

$container->register(TwigServiceProvider::class);
```

The provider registers:

- `Twig\Environment`
- `Twig\Loader\FilesystemLoader`
- `Maduser\Argon\Twig\TemplatePathRegistry`
- `Maduser\Argon\Twig\Config\TwigConfig`

Existing container definitions are not replaced.

Template Paths
--------------

[](#template-paths)

By convention, the provider uses `resources/templates` below the `basePath` container parameter:

```
$container->getParameters()->set('basePath', dirname(__DIR__));
```

You can override the default path explicitly:

```
use Maduser\Argon\Twig\Config\TwigParameter;

$container->getParameters()->set(TwigParameter::DEFAULT_PATH, __DIR__ . '/../templates');
```

Module providers can add namespaced template paths:

```
use Maduser\Argon\Container\AbstractServiceProvider;
use Maduser\Argon\Container\ArgonContainer;
use Maduser\Argon\Twig\TemplatePathRegistry;

final class AuthServiceProvider extends AbstractServiceProvider
{
    #[\Override]
    public function register(ArgonContainer $container): void
    {
        $registry = $container->get(TemplatePathRegistry::class);

        $registry->addPath(__DIR__ . '/resources/templates', 'auth');
    }
}
```

Templates in that folder can then be rendered with Twig's namespace syntax:

```
$html = $twig->render('@auth/login.html.twig');
```

Configuration
-------------

[](#configuration)

All configuration is optional and uses container parameters:

```
use Maduser\Argon\Twig\Config\TwigParameter;

$parameters = $container->getParameters();
$parameters->set(TwigParameter::DEBUG, true);
$parameters->set(TwigParameter::AUTO_RELOAD, true);
$parameters->set(TwigParameter::STRICT_VARIABLES, true);
$parameters->set(TwigParameter::CACHE, dirname(__DIR__) . '/storage/cache/twig');
```

`TwigParameter::CACHE` accepts a string path or `false`.

Boundaries
----------

[](#boundaries)

This package only wires Twig into an Argon container. It does not define view responses, controller conventions, template inheritance rules, asset handling, or module discovery.

Quality Gates
-------------

[](#quality-gates)

```
composer check
composer test:coverage
composer psalm
composer phpcs
```

###  Health Score

37

—

LowBetter than 81% of packages

Maintenance88

Actively maintained with recent releases

Popularity0

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

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

Unknown

Total

1

Last Release

60d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/7fb9da5a15010d335622bf9f465a32ef79c8d1cffcd139c2a9114736b72e2c13?d=identicon)[jdu](/maintainers/jdu)

---

Top Contributors

[![judus](https://avatars.githubusercontent.com/u/1478654?v=4)](https://github.com/judus "judus (2 commits)")

###  Code Quality

TestsPHPUnit

Static AnalysisPsalm

Code StylePHP\_CodeSniffer

Type Coverage Yes

### Embed Badge

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

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

###  Alternatives

[craftcms/cms

Craft CMS

3.6k3.6M3.2k](/packages/craftcms-cms)

PHPackages © 2026

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