PHPackages                             setono/php-templates - 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. setono/php-templates

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

setono/php-templates
====================

An extremely simple, yet wonderful, php template system

v1.2.0(3y ago)32.6k[1 PRs](https://github.com/Setono/php-templates/pulls)3MITPHPPHP &gt;=7.2

Since May 7Pushed 2y ago1 watchersCompare

[ Source](https://github.com/Setono/php-templates)[ Packagist](https://packagist.org/packages/setono/php-templates)[ RSS](/packages/setono-php-templates/feed)WikiDiscussions master Synced 3w ago

READMEChangelog (3)Dependencies (3)Versions (5)Used By (3)

PHP templates - An extremely simple, yet wonderful, PHP template system
=======================================================================

[](#php-templates---an-extremely-simple-yet-wonderful-php-template-system)

[![Latest Version](https://camo.githubusercontent.com/a5506f7a74bd5a2c4aac3622044de38696ad76aebc689b9e5ef216c7ecdbc2a5/68747470733a2f2f706f7365722e707567782e6f72672f7365746f6e6f2f7068702d74656d706c617465732f762f737461626c65)](https://packagist.org/packages/setono/php-templates)[![Latest Unstable Version](https://camo.githubusercontent.com/ac134933818b87a926efafc332c5fc5e8148d53e5b53f31f34796fd1436cd59a/68747470733a2f2f706f7365722e707567782e6f72672f7365746f6e6f2f7068702d74656d706c617465732f762f756e737461626c65)](https://packagist.org/packages/setono/php-templates)[![Software License](https://camo.githubusercontent.com/8b8a37db70673a8526a280334dd5f6ef2cc81a12611a7f0c807647e9e99d4e6f/68747470733a2f2f706f7365722e707567782e6f72672f7365746f6e6f2f7068702d74656d706c617465732f6c6963656e7365)](LICENSE)[![Build Status](https://github.com/Setono/php-templates/workflows/build/badge.svg)](https://github.com/Setono/php-templates/actions)[![Coverage Status](https://camo.githubusercontent.com/d845de09468f25b8d1ed88b28033543d79a18376b3ef03b9ab5003aae5a572bd/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f5365746f6e6f2f7068702d74656d706c617465732e737667)](https://scrutinizer-ci.com/g/Setono/php-templates/code-structure)[![Quality Score](https://camo.githubusercontent.com/12dbda20019e5175e26911f6e057dd10ae186b02cefe11ee00d07f5dd63945ca/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f5365746f6e6f2f7068702d74656d706c617465732e737667)](https://scrutinizer-ci.com/g/Setono/php-templates)

In the PHP world we have wonderful template engines/systems like [Twig](https://twig.symfony.com/)and [Plates](http://platesphp.com/). If you need features like inheritance, extensions, built-in helpers etc. you should go with one of those.

On the other hand, if you just want to be able to create a PHP template like this:

```
Hello
Today's date is format('d.m.Y')?>
```

Then this library is for you.

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

[](#installation)

```
$ composer require setono/php-templates
```

Usage
-----

[](#usage)

In this example I assume your templates are here: `templates/php` and you have a template like this:

```

Hello
```

The path of this template is divided into three parts: `templates/php` is the path added to the engine. `App` is the namespace. `hello` is the template name.

Keep this in mind when looking at the rendering of this template:

```
