PHPackages                             aatis/template-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. aatis/template-renderer

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

aatis/template-renderer
=======================

Template renderer of Aatis

1.3.0(9mo ago)01912PHPPHP &gt;=8.2

Since Dec 4Pushed 9mo ago1 watchersCompare

[ Source](https://github.com/BatMaxou/aatis-template-renderer)[ Packagist](https://packagist.org/packages/aatis/template-renderer)[ RSS](/packages/aatis-template-renderer/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (11)Used By (2)

Aatis Template Renderer
=======================

[](#aatis-template-renderer)

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

[](#installation)

```
composer require aatis/template-renderer
```

Dependencies
------------

[](#dependencies)

- `twig/twig`
- `aatis/dependency-injection` ()
- `aatis/stacking-service` ()

Usage
-----

[](#usage)

### Requirements

[](#requirements)

Add the `TemplateRenderer` service into the `Container`.

```
# In config/services.yaml file :

include_services:
  - 'Aatis\TemplateRenderer\Service\TemplateRenderer'
```

```
// Directly in PHP code when building the container :

(new ContainerBuilder($ctx))
    ->register(TemplateRenderer::class)
    ->build();
```

### Basic usage

[](#basic-usage)

Call `render()` method with template path and an optionnal array of data.

```
$templateRenderer->render('path/to/template', [
    'var_name' => 'value'
]);
```

### Custom Template Renderer

[](#custom-template-renderer)

By default, this template renderer supports `.html`, `.tpl.php` and `.html.twig` files.

You can add your own template renderer by creating a class that extends `AbstractTemplateRenderer`.

This Custom Template Renderer must contains:

- `EXTENSION` constant calling the case of the enum corresponding to the target extension.
- `render()` method that will be called by the base template renderer.

```
class ExtraRenderer extends AbstractTemplateRenderer
{
    public const EXTENSION = '.tpl.extra';

    public function render(string $template, array $vars = []): string
    {
        // Transform the special extension type template into a string
    }
}
```

If needed, you can use the `getTemplateContent()` method of the `AbstractTemplateRenderer` to extract the vars and get the content of the template which will be rendered.

```
class ExtraRenderer extends AbstractTemplateRenderer
{
    public const EXTENSION = '.tpl.extra';

    public function render(string $template, array $vars = []): string
    {
        // do some stuff
        $content = $this->getTemplateContent($template, $vars);
        // do some stuff and return the content
    }
}
```

###  Health Score

38

—

LowBetter than 85% of packages

Maintenance57

Moderate activity, may be stable

Popularity13

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity61

Established project with proven stability

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

Recently: every ~136 days

Total

8

Last Release

287d ago

Major Versions

0.1.0 → 1.0.02023-12-08

### Community

Maintainers

![](https://www.gravatar.com/avatar/2f62599db29152e0adf71ca1df468470b4d572bc556a4a634dc6c016157a5044?d=identicon)[Aatis](/maintainers/Aatis)

---

Top Contributors

[![BatMaxou](https://avatars.githubusercontent.com/u/90443919?v=4)](https://github.com/BatMaxou "BatMaxou (10 commits)")

### Embed Badge

![Health badge](/badges/aatis-template-renderer/health.svg)

```
[![Health](https://phpackages.com/badges/aatis-template-renderer/health.svg)](https://phpackages.com/packages/aatis-template-renderer)
```

###  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)
