PHPackages                             softwarezhu/pate - 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. softwarezhu/pate

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

softwarezhu/pate
================

Pate is a PHP Attribute Template Engine inspired by PHPTAL but run much faster. It use native dom to make it fast.

1.1.1(9y ago)012LGPL-2.1+PHPPHP &gt;=5.3

Since Mar 20Pushed 9y ago1 watchersCompare

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

READMEChangelog (3)Dependencies (1)Versions (4)Used By (0)

Pate
====

[](#pate)

Pate is a PHP Attribute Template Engine inspired by PHPTAL but run much faster. It uses syntax like angular and vue, But renders on the server side. It's compatible with PHPTAL.

Why Use Pate Instead Of PHPTAL?
-------------------------------

[](#why-use-pate-instead-of-phptal)

I use [PHPTAL](https://github.com/phptal/PHPTAL) as our template engine in one of my Project. But is was **TOO SLOW**!!, and **TOO COMPLICATED**. So I decide to rewrite a similar Template Engine named **PATE**.

Here are some advantages:

- TREE times faster than PHPTAL. PHPTAL takes several seconds to render a big page(abount 150k), but PATE is more than 3 times faster.
- PATE is Extremely Extensible. PATE is designed for extensible, You can create your own Syntax to enhance PATE's feature.
- PATE is Extremely Easy. There are only 1/10 codes of PHPTAL, but much more powerful.
- PATE's compiled file is VERY READABLE. But PHPTAL's compiled file is complicated and very hard to read.
- PHPTAL is too strict with dom and variables, error occurs frequently. Pate is friendly.

Requirements
------------

[](#requirements)

To use Pate, you need

- PHP &gt;= 5.4.
- With **dom** extension installed.

Install
-------

[](#install)

With composer

> composer require softwarezhu/pate

Examples
========

[](#examples)

Attributes
----------

[](#attributes)

Template file

```

```

Do render(ie. This template is named 'template.html')

```
use Pate\PateTemplate;

$template = new PateTemplate();
$template->loadHtmlFile('template.html');
$content = $template->render(array(
    'data' => array(
        'src' => 'htttp://github.com/logo.jpg',
        'title' => 'Github Logo'
    )
));

echo $content;
```

The render result will be

```

```

Template Syntax
===============

[](#template-syntax)

Attributes
----------

[](#attributes-1)

```

```

The img *src* and *alt* attributes will be replaced by the data\['src'\] value and data\['title'\] value. The multiple attributes use ";" to separate.

Text
----

[](#text)

```
 This content will be replaced after rendered.
```

Loop
----

[](#loop)

```
This content will be replaced by product/title after rendered.
```

If the count of products is N, there will be N tr lines.

If
--

[](#if)

```
 If product/isPromote is false, this block will be removed from the dom.
```

`tal:condition` likes `if` in php.

Replace
-------

[](#replace)

```
 This entire DIV will be replaced with '123'(not the inner text).
```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity5

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 ~0 days

Total

3

Last Release

3389d ago

PHP version history (2 changes)1.0PHP &gt;=5.4

1.1PHP &gt;=5.3

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/4102501?v=4)[zhu lin](/maintainers/softwarezhu)[@softwarezhu](https://github.com/softwarezhu)

---

Top Contributors

[![softwarezhu](https://avatars.githubusercontent.com/u/4102501?v=4)](https://github.com/softwarezhu "softwarezhu (23 commits)")

---

Tags

patephp-domphptaltemplate-enginetemplate enginezopepate

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/softwarezhu-pate/health.svg)

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

###  Alternatives

[phptal/phptal

PHPTAL is a templating engine for PHP5 that implements Zope Page Templates syntax

182444.0k20](/packages/phptal-phptal)[foil/foil

PHP template engine for native PHP templates

170112.7k10](/packages/foil-foil)[namesco/ztal

ZTal makes integrating the PHP templating system PHPTAL into Zend Framework easy.

2119.9k](/packages/namesco-ztal)[proai/laravel-handlebars

A Laravel wrapper for LightnCandy for using the Handlebars (and Mustache) template engine.

38207.7k](/packages/proai-laravel-handlebars)[wanze/template-engine-factory

Provides ProcessWire integration for various template engines such as Twig.

2712.4k4](/packages/wanze-template-engine-factory)[talesoft/tale-pug

A clean, lightweight and easy-to-use templating engine for PHP based on Pug, formerly Jade

319.5k3](/packages/talesoft-tale-pug)

PHPackages © 2026

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