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)0511PHP

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 yesterday

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

Maintenance20

Infrequent updates — may be unmaintained

Popularity10

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

1002d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/493534?v=4)[pio](/maintainers/pio)[@pio](https://github.com/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

[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3851.2M](/packages/limenius-react-bundle)[area17/laravel-auto-head-tags

Laravel Auto Head Tags helps you build the list of head elements for your app

4616.1k](/packages/area17-laravel-auto-head-tags)[jelix/wikirenderer

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

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

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

282.2k](/packages/webkinder-sproutset)

PHPackages © 2026

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