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(11mo ago)01912PHPPHP &gt;=8.2

Since Dec 4Pushed 11mo 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 today

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

36

—

LowBetter than 79% of packages

Maintenance52

Moderate activity, may be stable

Popularity10

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

333d ago

Major Versions

0.1.0 → 1.0.02023-12-08

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/38766933?v=4)[AATIS, Inc.](/maintainers/Aatis)[@aatis](https://github.com/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

[craftcms/cms

Craft CMS

3.6k3.6M3.1k](/packages/craftcms-cms)[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)
