PHPackages                             srcoder/template-bridge - 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. srcoder/template-bridge

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

srcoder/template-bridge
=======================

Template bridge between your legacy and other template engines

1.0.2(8y ago)133MITPHPPHP ~7.0

Since Aug 23Pushed 8y ago1 watchersCompare

[ Source](https://github.com/JeroenBoersma/php-template-bridge)[ Packagist](https://packagist.org/packages/srcoder/template-bridge)[ RSS](/packages/srcoder-template-bridge/feed)WikiDiscussions master Synced 3d ago

READMEChangelogDependencies (2)Versions (10)Used By (0)

Template bridge
===============

[](#template-bridge)

Template bridge between your legacy php code and newer template engines.

Dependencies
------------

[](#dependencies)

Requires minimum of PHP 7.0. Also uses `srcoder/normalize-strings` for string manipulation.

Engines
-------

[](#engines)

- Plain
- Twig
- Compatible

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

[](#basic-usage)

Use the manager to define your templates.

```
use \Srcoder\TemplateBridge\Manager;
use \Srcoder\TemplateBridge\Engine\Twig;
use \Srcoder\TemplateBridge\Engine\Plain;

// Initialize template bridge
$templateBridge = new Manager;
// or static
$templateBridge = Manager::instance();

// Add a engine
$templateBridge->add(
        'twig',         // Name
        new Twig(),     // Template engine
        300             // Prio, higher is more important
);

$templateBridge->add(
        'plain',        // Name
        new Plain(),    // Template engine
        600             // Prio, higher is more important
);

// Adding a file
$templateManager->addFile('file');
// Will search for file.twig and file

// Render template
echo $templateBridge->render();
```

Data
----

[](#data)

When rendering something you can add data to it.

```
use \Srcoder\TemplateBridge\Data;

echo $templateBridge->render(new Data(['key' => 'value']))
```

Fun part
--------

[](#fun-part)

### Twig engine

[](#twig-engine)

When a Twig file is found it will work exactly as you expect.

### Plain engine

[](#plain-engine)

Plain files will replace {{$variable}} from the Data object Plain engine can also be used for javascript and html

### Compatible engine

[](#compatible-engine)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity64

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 ~14 days

Recently: every ~26 days

Total

9

Last Release

3074d ago

Major Versions

0.10.3 → 1.0.02017-12-13

### Community

Maintainers

![](https://www.gravatar.com/avatar/1548630acefd0c1ac8002a37135d67741307f978296ac628422e3923b7a3766b?d=identicon)[JeroenBoersma](/maintainers/JeroenBoersma)

---

Top Contributors

[![JeroenBoersma](https://avatars.githubusercontent.com/u/1163348?v=4)](https://github.com/JeroenBoersma "JeroenBoersma (26 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/srcoder-template-bridge/health.svg)

```
[![Health](https://phpackages.com/badges/srcoder-template-bridge/health.svg)](https://phpackages.com/packages/srcoder-template-bridge)
```

###  Alternatives

[mustache/mustache

A Mustache implementation in PHP.

3.3k44.6M291](/packages/mustache-mustache)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[whitecube/nova-flexible-content

Flexible Content &amp; Repeater Fields for Laravel Nova.

8053.0M25](/packages/whitecube-nova-flexible-content)[mopa/bootstrap-bundle

Easy integration of twitters bootstrap into symfony2

7042.9M33](/packages/mopa-bootstrap-bundle)[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3871.2M](/packages/limenius-react-bundle)[nicmart/string-template

StringTemplate is a very simple string template engine for php. I've written it to have a thing like sprintf, but with named and nested substutions.

2101.7M30](/packages/nicmart-string-template)

PHPackages © 2026

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