PHPackages                             pytocryto/pytotpl - 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. pytocryto/pytotpl

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

pytocryto/pytotpl
=================

A PHP template engine

1.0.0(8y ago)0201MITPHPPHP &gt;=5.6.4

Since Apr 26Pushed 8y agoCompare

[ Source](https://github.com/PytoCryto/PytoTPL)[ Packagist](https://packagist.org/packages/pytocryto/pytotpl)[ RSS](/packages/pytocryto-pytotpl/feed)WikiDiscussions master Synced 2d ago

READMEChangelogDependencies (3)Versions (2)Used By (1)

PytoTPL template engine
=======================

[](#pytotpl-template-engine)

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

[](#installation)

Install via composer

```
composer require pytocryto/pytotpl

```

Initiate &amp; configure PytoTPL

```
$tpl = new \PytoTPL\PytoTPL();
$tpl->setConfig([
    'tpl_folder'      => __DIR__ . '/dir/to/templates/',
    'cache_folder'    => __DIR__ . '/dir/to/cache/',
    'tpl_file_format' => '.tpl',
    'compress'        => false, // compression only available in a valid  document
    'event_emitter'   => true, // set to false for better performance
]);
```

---

### Outputs:

[](#outputs)

```
{$variable}

{$array.key1.key2.key3}

{echo $variable}

{print $variable}

{$variable|substr:0,-1}
```

---

### Unescaped output:

[](#unescaped-output)

```
{!! $variable !!}
```

---

### Loops:

[](#loops)

```
{foreach: $myArray as $item}
..
{/foreach}

{for: $i = 0; $i
