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

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

akawalko/template-renderer-interface
====================================

Interface for a class that renders templates for string and PSR-7 response objects.

v1.0.0(2y ago)0111MITPHPPHP ^7.2 || ^8.0

Since Jan 4Pushed 2y ago1 watchersCompare

[ Source](https://github.com/akawalko/template-renderer-interface)[ Packagist](https://packagist.org/packages/akawalko/template-renderer-interface)[ RSS](/packages/akawalko-template-renderer-interface/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (1)Versions (2)Used By (1)

template-renderer-interface
===========================

[](#template-renderer-interface)

Interface for a class that renders templates for string and [PSR-7](https://www.php-fig.org/psr/psr-7/) response objects.

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

[](#installation)

You can download this library using [Composer](https://getcomposer.org/):

Require php: &gt;=7.2

```
composer require akawalko/template-renderer-interface

```

Methods
-------

[](#methods)

### \_\_get(string $name);

[](#__getstring-name)

Get template variable. Return mixed value.

### \_\_set(string $name, $value): void;

[](#__setstring-name-value-void)

Set template variable.

### \_\_isset(string $name): bool;

[](#__issetstring-name-bool)

Determine if a variable is declared and is different than null.

### \_\_unset(string $name): void;

[](#__unsetstring-name-void)

Unset a given variable

### getVar(string $name);

[](#getvarstring-name)

Get template variable. Return mixed value.

### setVar(string $name, $value): self;

[](#setvarstring-name-value-self)

Set template variable.

### getVars(): array;

[](#getvars-array)

Get template variables.

### setVars($data = \[\]): self;

[](#setvarsdata---self)

Set template variables from assoc. array or object.

### renderToString(string $templatePath, $data = \[\]): string;

[](#rendertostringstring-templatepath-data---string)

Render the template to string with given data.

### renderToResponse(ResponseInterface $response, string $templatePath, $data = \[\]): ResponseInterface;

[](#rendertoresponseresponseinterface-response-string-templatepath-data---responseinterface)

Render the template to PSR compliant Response class with given data.

### render(...$arguments);

[](#renderarguments)

A shortcut method that executes renderToString() or renderToResponse() based on the arguments passed. Return ResponseInterface or string.

###  Health Score

22

—

LowBetter than 21% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity47

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

910d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8fca236fe992bd3222344ed9cb9296e25b3c3753dc18054d2175a5926c6be9a1?d=identicon)[akawalko](/maintainers/akawalko)

---

Top Contributors

[![akawalko](https://avatars.githubusercontent.com/u/7594428?v=4)](https://github.com/akawalko "akawalko (8 commits)")

### Embed Badge

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

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

###  Alternatives

[aws/aws-sdk-php

AWS SDK for PHP - Use Amazon Web Services in your PHP project

6.3k543.5M2.6k](/packages/aws-aws-sdk-php)[symfony/symfony

The Symfony PHP framework

31.4k87.2M2.2k](/packages/symfony-symfony)[guzzlehttp/psr7

PSR-7 message implementation that also provides common utility methods

8.0k1.1B4.0k](/packages/guzzlehttp-psr7)[moonshine/moonshine

Laravel administration panel

1.3k253.1k81](/packages/moonshine-moonshine)[neuron-core/neuron-ai

The PHP Agentic Framework.

2.0k656.1k38](/packages/neuron-core-neuron-ai)[algolia/algoliasearch-client-php

API powering the features of Algolia.

69735.1M157](/packages/algolia-algoliasearch-client-php)

PHPackages © 2026

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