PHPackages                             componenta/templater - 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. componenta/templater

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

componenta/templater
====================

Template rendering contracts and Plates adapter for Componenta

v1.0.0(1mo ago)081MITPHPPHP ^8.4

Since Jun 16Pushed 1mo agoCompare

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

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

Componenta Templater
====================

[](#componenta-templater)

Template rendering contracts and a League Plates adapter for Componenta. The package provides a small renderer abstraction while keeping application bootstrapping in `componenta/templater-app`.

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

[](#installation)

```
composer require componenta/templater
```

Main API
--------

[](#main-api)

`RendererInterface` is the public rendering contract:

```
interface RendererInterface
{
    public function render(string $template, array $params = []): string;
}
```

`Renderer` implements the contract with a required `Engine` instance. `Engine` extends `League\Plates\Engine` and adds a configurable template factory hook.

TypeResponsibility`RendererInterface`Stable contract for rendering a template name with parameters.`Renderer`Thin adapter around `Engine`; exposes `engine()` when callers need direct Plates access.`Engine`Plates engine subclass with an optional template factory hook.`Engine` keeps the normal Plates constructor shape:

```
new Engine(
    directory: __DIR__ . '/templates',
    fileExtension: 'phtml',
    templateFactory: null,
);
```

The third argument can be any callable with the shape `callable(Engine $engine, string $name): League\Plates\Template\Template`. You can also install it later:

```
$engine->setTemplateFactory(
    static fn (Engine $engine, string $name) => $engine->getTemplate($name),
);
```

Quick Start
-----------

[](#quick-start)

```
use Componenta\Templater\Engine;
use Componenta\Templater\Renderer;

$renderer = new Renderer(new Engine(__DIR__ . '/templates', 'phtml'));

echo $renderer->render('welcome', ['name' => 'Componenta']);
```

Use `RendererInterface` in application services. Use `Renderer::engine()` only when a caller must add folders, register functions, or call Plates-specific APIs.

Boundary
--------

[](#boundary)

This package does not register container services, does not resolve template paths, and does not define the global `view()` helper. Use `componenta/templater-app` for application integration.

###  Health Score

41

—

FairBetter than 87% of packages

Maintenance91

Actively maintained with recent releases

Popularity6

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity51

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

43d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/20490712?v=4)[Andrey Shelamkoff](/maintainers/Shelamkoff)[@Shelamkoff](https://github.com/Shelamkoff)

---

Top Contributors

[![Shelamkoff](https://avatars.githubusercontent.com/u/20490712?v=4)](https://github.com/Shelamkoff "Shelamkoff (1 commits)")

### Embed Badge

![Health badge](/badges/componenta-templater/health.svg)

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

###  Alternatives

[franzl/laravel-plates

The powerful native PHP templating system Plates for Laravel.

183.3k](/packages/franzl-laravel-plates)

PHPackages © 2026

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