Download the PHP package softwarezhu/pate without Composer
On this page you can find all versions of the php package softwarezhu/pate. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download softwarezhu/pate
More information about softwarezhu/pate
Files in softwarezhu/pate
Package pate
Short Description Pate is a PHP Attribute Template Engine inspired by PHPTAL but run much faster. It use native dom to make it fast.
License LGPL-2.1+
Informations about the package 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?
I use 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
To use Pate, you need
-
PHP >= 5.4.
- With dom extension installed.
Install
With composer
composer require softwarezhu/pate
Examples
Attributes
Template file
Do render(ie. This template is named 'template.html')
The render result will be
Template Syntax
Attributes
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
Loop
If the count of products is N, there will be N tr lines.
If
tal:condition
likes if
in php.
Replace
All versions of pate with dependencies
ext-dom Version *