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

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

php-compatible/templates
========================

Modern PHP-style templating that works on PHP 5.5+

v1.0.0(4mo ago)02MITPHPPHP &gt;=5.5CI passing

Since Dec 30Pushed 4mo agoCompare

[ Source](https://github.com/php-compatible/templates)[ Packagist](https://packagist.org/packages/php-compatible/templates)[ RSS](/packages/php-compatible-templates/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (1)Versions (2)Used By (0)

templates
=========

[](#templates)

[![CI](https://github.com/php-compatible/templates/actions/workflows/ci.yml/badge.svg)](https://github.com/php-compatible/templates/actions/workflows/ci.yml)[![codecov](https://camo.githubusercontent.com/068c9e1d7159d94f36b84b1c33ad4926acb439ce29b48a9d44f8fb944b43d1a1/68747470733a2f2f636f6465636f762e696f2f67682f7068702d636f6d70617469626c652f74656d706c617465732f6272616e63682f6d61696e2f67726170682f62616467652e737667)](https://codecov.io/gh/php-compatible/templates)[![PHP Version](https://camo.githubusercontent.com/648fd4043ad1c6bc7ca4afda2b41a7d7a03c84e87512ef4615f5acbcc49569ee/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f7068702d352e352532302d2d253230382e352d3838393242462e737667)](https://php.net/)[![License](https://camo.githubusercontent.com/7013272bd27ece47364536a221edb554cd69683b68a46fc0ee96881174c4214c/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e737667)](https://github.com/php-compatible/templates/blob/main/LICENSE)

**Blazing fast PHP templating with zero dependencies.**

A lightweight, high-performance template engine that leverages PHP's native output buffering for maximum speed. No parsing overhead, no compilation step, no caching layer needed - just pure PHP execution at full speed.

Why templates?
--------------

[](#why-templates)

- **Zero overhead** - Uses PHP's native `require` and output buffering. No regex parsing, no AST compilation, no runtime interpretation.
- **Instant rendering** - Templates execute as native PHP code. What you write is what runs.
- **No dependencies** - A single function. No framework required. No external libraries.
- **Legacy compatible** - Works on PHP 5.5 through 8.x. Modernize your legacy codebase without breaking compatibility.
- **Familiar syntax** - It's just PHP. No new template language to learn.

Documentation
-------------

[](#documentation)

Full documentation available at **[phpcompatible.dev/docs/category/templates](https://phpcompatible.dev/docs/category/templates)**

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

[](#installation)

```
composer require php-compatible/templates
```

Quick Start
-----------

[](#quick-start)

Create a template file `views/hello.php`:

```

```

Render it:

```
