PHPackages                             antonkalmykov/piece - 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. antonkalmykov/piece

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

antonkalmykov/piece
===================

Simple template engine for ItCourses Framework

v1.1.1(10y ago)225MITPHPPHP &gt;=5.5.9

Since Feb 4Pushed 10y ago1 watchersCompare

[ Source](https://github.com/kalmykovanton/Piece)[ Packagist](https://packagist.org/packages/antonkalmykov/piece)[ Docs](https://github.com/kalmykovanton/Piece)[ RSS](/packages/antonkalmykov-piece/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependenciesVersions (4)Used By (0)

Piece
=====

[](#piece)

Simple template engine component for ITCourses Jazz PHP framework

How to use:
-----------

[](#how-to-use)

First of all, create an array of settings for Piece component:

```
// settings array
$settings = [
    // folder, where you store your view's
    'viewsFolder' => __DIR__ . '/views',
    // file extension, which you use for your
    // template and views files
    'fileExtension' => '.phtml'
];
```

After that, create an instance of Piece component and pass into it your settings array:

```
use Piece\ViewEngine;
$view = new ViewEngine($settings);
```

Now, you can run Piece's render() method, which it first argument is name of view and second - array of view's parameters (if any):

```
$view->render('home', ['content'=>'Some content for home page.']);
```

Supposing our view's files stored in *Views* folder and template's files in *Views/templates* folder.

**Views/home.phtml** view example:

```
@template('templates/template');

This is view content.

```

In this case, **@template('templates/template');** flag tell Piece's render() method where it can find template for this view.

**Views/templates/template.phtml** template example:

```

    Home page

    @embed;

```

**@embed;** flag tell Piece's render() method where it must inject view's body.

You can use any PHP construction and variables, in view's files and template's files. All of they are processed by render() method.

This method also provides XSS protection.

###  Health Score

27

—

LowBetter than 47% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity60

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

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

Every ~6 days

Total

3

Last Release

3787d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/12529715?v=4)[Anton Kalmykov](/maintainers/kalmykovanton)[@kalmykovanton](https://github.com/kalmykovanton)

---

Top Contributors

[![kalmykovanton](https://avatars.githubusercontent.com/u/12529715?v=4)](https://github.com/kalmykovanton "kalmykovanton (10 commits)")

### Embed Badge

![Health badge](/badges/antonkalmykov-piece/health.svg)

```
[![Health](https://phpackages.com/badges/antonkalmykov-piece/health.svg)](https://phpackages.com/packages/antonkalmykov-piece)
```

###  Alternatives

[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3861.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.0k](/packages/area17-laravel-auto-head-tags)[jelix/wikirenderer

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

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

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

281.8k](/packages/webkinder-sproutset)

PHPackages © 2026

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