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 1mo ago

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 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity46

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

857d 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

[moonshine/moonshine

Laravel administration panel

1.3k217.1k59](/packages/moonshine-moonshine)[modx/revolution

MODX Revolution is a Content Management System

1.4k9.1k12](/packages/modx-revolution)[rareloop/lumberjack-core

A powerful MVC framework for the modern WordPress developer. Write better, more expressive and easier to maintain code

42155.0k19](/packages/rareloop-lumberjack-core)

PHPackages © 2026

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