PHPackages                             losthost/template-helper - 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. losthost/template-helper

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

losthost/template-helper
========================

A helper class to use php-templates

v1.0.0(2y ago)0421PHP

Since Oct 6Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Datahider/Template-Helper)[ Packagist](https://packagist.org/packages/losthost/template-helper)[ RSS](/packages/losthost-template-helper/feed)WikiDiscussions master Synced 1mo ago

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

Template Helper
===============

[](#template-helper)

Loads and displays or processes a template file

Very simple usage
-----------------

[](#very-simple-usage)

```
use losthost\templateHelper\Template;

$template = new Template('template-file.tpl');
$template->display();

```

This will display the content of file `templates/default/template-file.tpl`. It seems not very usefull, so you can create more complex templates as in next example.

More complex usage
------------------

[](#more-complex-usage)

Create a template file ex. `templatex/default/simple-template.tpl` with code:

```
Hello !

```

Now to display "Hello John!" do the following:

```
use losthost\templateHelper\Template;

$template = new Template('simple-template.tpl');
$template->assing('name', 'John');
$template->display();

```

Multilang usage
---------------

[](#multilang-usage)

Use `$template = new Template('template.tpl', 'de');` to use templates in `templates/de/` instead of `templates/default/`.

You can change default templates dir from `templates/` to `anydir/` you want by using

```
$template->setTemplateDir('anydir')

```

Do not display output
---------------------

[](#do-not-display-output)

Sometimes you don't want to display output. You may need just to get the template output for further processing. Use this:

```
$result = $template->process(); // insead of $template->display();

```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity43

Maturing project, gaining track record

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

956d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d6034471e592d56036961af1cc7ae309cdc332e5eaae18b86c2d9ecde0aae773?d=identicon)[pio](/maintainers/pio)

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/losthost-template-helper/health.svg)

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

###  Alternatives

[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)[symfony/ux-icons

Renders local and remote SVG icons in your Twig templates.

555.8M69](/packages/symfony-ux-icons)

PHPackages © 2026

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