PHPackages                             simplydi/simplytemplate - 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. simplydi/simplytemplate

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

simplydi/simplytemplate
=======================

Very simple native PHP templating

10PHP

Since Aug 4Pushed 2y ago1 watchersCompare

[ Source](https://github.com/bharatkumar200/SimplyTemplate)[ Packagist](https://packagist.org/packages/simplydi/simplytemplate)[ RSS](/packages/simplydi-simplytemplate/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)DependenciesVersions (1)Used By (0)

SimplyTemplate
==============

[](#simplytemplate)

This is a very simple native PHP templating system for small projects.

**Notes**

- suitable for small projects only; for more complexity use League Plate, Twig, Latte, etc.
- currently in development = prone to errors
- created for learning purpose

Usage
-----

[](#usage)

Create the template to render. Extend a layout using `@extend=layoutName` directive.

You can escape the variables using `$this->esc($var)`.

```
// Template to render: "page.php"

@extend=_layout

```

**\_layout.php**:

```
DOCTYPE html>

        this is header

        footer here

```

To include any partial just use the php function `include()`.

**using the template engine to render:**

```
