PHPackages                             debuss-a/awareness-mezzio-template - 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. debuss-a/awareness-mezzio-template

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

debuss-a/awareness-mezzio-template
==================================

A set of interfaces and traits to make your classes AWARE, just like JCVD.

1.0.0(2mo ago)0111MITPHPPHP ^8.0

Since Apr 9Pushed 2mo agoCompare

[ Source](https://github.com/debuss/awareness-mezzio-template)[ Packagist](https://packagist.org/packages/debuss-a/awareness-mezzio-template)[ RSS](/packages/debuss-a-awareness-mezzio-template/feed)WikiDiscussions master Synced 1w ago

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

Awareness Mezzio Template
=========================

[](#awareness-mezzio-template)

`debuss-a/awareness-mezzio-template` provides a focused "aware" interface and trait for Mezzio template rendering.

It lets your classes declare that they need a `Mezzio\Template\TemplateRendererInterface` through a standard setter, making setter injection simple and consistent.

What is included?
-----------------

[](#what-is-included)

This package exposes:

- `Awareness\TemplateRendererAwareInterface`
- `Awareness\TemplateRendererAwareTrait`

The interface defines a `setTemplateRenderer()` method, and the trait provides a ready-to-use implementation with a `$templateRenderer` property.

Why use it?
-----------

[](#why-use-it)

This package is especially useful when your container supports inflectors or automatic setter injection.

Benefits include:

- ✅ A clear contract for classes that need a template renderer
- ✅ Reusable setter injection without duplicating boilerplate
- ✅ Easy integration with containers that can target an interface
- ✅ Simple testing by injecting a mocked or stubbed renderer

Basic usage
-----------

[](#basic-usage)

```
use Awareness\TemplateRendererAwareInterface;
use Awareness\TemplateRendererAwareTrait;

class PageAction implements TemplateRendererAwareInterface
{
    use TemplateRendererAwareTrait;

    public function renderHomepage(): string
    {
        return $this->templateRenderer->render('app::home');
    }
}
```

Using with an inflector
-----------------------

[](#using-with-an-inflector)

With a container such as [League Container](https://container.thephpleague.com/), you can automatically inject the Mezzio template renderer into any class implementing `TemplateRendererAwareInterface`.

```
use Awareness\TemplateRendererAwareInterface;
use League\Container\Container;
use Mezzio\Template\TemplateRendererInterface;

$container = new Container();

$container->add(TemplateRendererInterface::class, AppTemplateRenderer::class);

$container->inflector(TemplateRendererAwareInterface::class)
    ->invokeMethod('setTemplateRenderer', [TemplateRendererInterface::class]);
```

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

[](#installation)

```
composer require debuss-a/awareness-mezzio-template
```

Requirements
------------

[](#requirements)

- PHP 8.0 or higher
- `mezzio/mezzio-template` ^3.0

###  Health Score

36

—

LowBetter than 79% of packages

Maintenance88

Actively maintained with recent releases

Popularity5

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity38

Early-stage or recently created project

 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

61d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0e1a70117520fe10a630d61c750bbe6888d174e9903825e741470f818ee2c5d1?d=identicon)[debuss-a](/maintainers/debuss-a)

---

Top Contributors

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

### Embed Badge

![Health badge](/badges/debuss-a-awareness-mezzio-template/health.svg)

```
[![Health](https://phpackages.com/badges/debuss-a-awareness-mezzio-template/health.svg)](https://phpackages.com/packages/debuss-a-awareness-mezzio-template)
```

###  Alternatives

[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3861.2M](/packages/limenius-react-bundle)[wmde/php-vuejs-templating

PHP implementation of Vue.js templating engine

3041.6k2](/packages/wmde-php-vuejs-templating)[jelix/wikirenderer

WikiRenderer is a library to generate HTML or anything else from wiki content.

1712.2k1](/packages/jelix-wikirenderer)[webkinder/sproutset

A Composer package for handling responsive images in Roots Bedrock + Sage + Blade projects.

291.8k](/packages/webkinder-sproutset)

PHPackages © 2026

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