PHPackages                             sinevia/php-library-template - 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. sinevia/php-library-template

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

sinevia/php-library-template
============================

PHP Library Template

v1.4.0(7y ago)160211proprietaryPHP

Since Jan 4Pushed 6y ago1 watchersCompare

[ Source](https://github.com/Sinevia/php-library-template)[ Packagist](https://packagist.org/packages/sinevia/php-library-template)[ Docs](http://github.com/sinevia/php-library-template)[ RSS](/packages/sinevia-php-library-template/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (3)DependenciesVersions (4)Used By (1)

PHP Library Template
====================

[](#php-library-template)

Template is a simple, yet powerful templating engine in single file.

[![No Dependencies](https://camo.githubusercontent.com/e5650883bec05bec967678c8203c32b160b75c93b5b745c80bd9e6f25eb4a3db/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6e6f2d646570656e64656e636965732d737563636573732e737667)](https://camo.githubusercontent.com/e5650883bec05bec967678c8203c32b160b75c93b5b745c80bd9e6f25eb4a3db/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6e6f2d646570656e64656e636965732d737563636573732e737667)

Features
--------

[](#features)

- Single file. No external dependencies
- No new "language" to learn. Familiar PHP syntax.
- Default templates extension .phtml

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

[](#installation)

Add the following to your composer file:

```
    "require": {
        "sinevia/php-library-template": "1.*"
    },
```

Functionality
-------------

[](#functionality)

### 1) From File

[](#1-from-file)

```
\Sinevia\Template::fromFile($templateFilepath, $data = array());
```

### 2) From String

[](#2-from-string)

```
\Sinevia\Template::fromString($templateString, $data = array());
```

### 3) Cache

[](#3-cache)

```
\Sinevia\Template::setCacheDirectory($cacheDirPath);
\Sinevia\Template::setCache($key, $content, $options = array());
\Sinevia\Template::getCache($key, $options = array());
```

### 3) Helpers

[](#3-helpers)

```
\Sinevia\Template::minifyHtml($html);
\Sinevia\Template::minifyCss($css);
\Sinevia\Template::minifyJs($js);
```

Usage
-----

[](#usage)

```
$html = \Sinevia\Template::fromString($templateContent, [
     'page_meta_description' => $pageMetaDescription,
     'page_meta_keywords' => $pageMetaKeywords,
     'page_meta_robots' => $pageMetaRobots,
     'page_canonical_url' => $pageCanonicalUrl,
     'page_title' => $pageTitle,
     'page_content' => $pageContent,
]);
```

```
\Sinevia\Template::setCache('key','content',array(
     'post'=>true,
     'get'=>true,
     'session'=>true,
     'expires'=>3600 // Default
));
```

Layout
------

[](#layout)

1. Template file:

```
[layout::public/guest/layout.phtml]

CONTENT
```

2. Layout file:

```

```

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community12

Small or concentrated contributor base

Maturity65

Established project with proven stability

 Bus Factor1

Top contributor holds 92.9% 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 ~205 days

Total

3

Last Release

2643d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/d935723d26f92caa8fb66c4a44cf1995c488734b54e36f5b616ac290a109ab59?d=identicon)[sinevia](/maintainers/sinevia)

---

Top Contributors

[![Sinevia](https://avatars.githubusercontent.com/u/3450815?v=4)](https://github.com/Sinevia "Sinevia (13 commits)")[![lesichkovm](https://avatars.githubusercontent.com/u/7744963?v=4)](https://github.com/lesichkovm "lesichkovm (1 commits)")

---

Tags

phplibrarytemplatesinevia

### Embed Badge

![Health badge](/badges/sinevia-php-library-template/health.svg)

```
[![Health](https://phpackages.com/badges/sinevia-php-library-template/health.svg)](https://phpackages.com/packages/sinevia-php-library-template)
```

PHPackages © 2026

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