PHPackages                             dzentota/template-engine - 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. dzentota/template-engine

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

dzentota/template-engine
========================

A secure template engine with native PHP syntax and context-aware escaping

06PHP

Since Mar 25Pushed 1mo agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

dzentota/template-engine
========================

[](#dzentotatemplate-engine)

A secure template engine for PHP with native syntax and context-aware escaping, built on top of `dzentota/template-variable` and `dzentota/typedvalue`.

Features
--------

[](#features)

🔒 **Security First**: Built following the [AppSec Manifesto](https://github.com/dzentota/AppSecManifesto) principles

- Context-aware automatic escaping (HTML, attributes, JavaScript, CSS, URLs)
- Protection against XSS attacks
- Secure by default configuration
- Template security auditing

🚀 **Native PHP Syntax**: Similar to bareui, uses familiar PHP syntax

- No custom template language to learn
- Full PHP power when needed
- Clean, readable templates

⚡ **Performance**:

- Optional template caching
- Optimized for production use
- Minimal overhead

🛡️ **Developer Experience**:

- Comprehensive error handling
- Debug mode for development
- Template includes and partials
- Global variables support
- Namespaced template directories

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

[](#installation)

```
composer require dzentota/template-engine
```

**Note:** This package depends on development versions of `dzentota/template-variable` and `dzentota/typedvalue`. You may need to adjust your `minimum-stability` setting in `composer.json` to `"dev"` or use `--prefer-source` flag during installation.

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

[](#quick-start)

```
