templado / engine
A pragmatic approach to templating for PHP 8.2+
Fund package maintenance!
theseer
Installs: 14 295
Dependents: 3
Suggesters: 0
Security: 0
Stars: 50
Watchers: 8
Forks: 7
Open Issues: 2
Requires
- php: ^8.2
- ext-dom: *
- ext-libxml: *
- ext-xmlwriter: *
- theseer/css2xpath: ^2.0
- dev-main
- 5.0.0-rc.5
- 5.0.0-rc.4
- 5.0.0-rc.3
- 5.0.0-rc.2
- 5.0.0-rc.1
- 4.x-dev
- 4.2.5
- 4.2.4
- 4.2.3
- 4.2.2
- 4.2.1
- 4.2.0
- 4.1.4
- 4.1.3
- 4.1.2
- 4.1.1
- 4.1.0
- 4.0.6
- 4.0.5
- 4.0.4
- 4.0.3
- 4.0.2
- 4.0.1
- 4.0.0
- 3.0.1
- 3.0.0
- 2.3.2
- 2.3.1
- 2.3.0
- 2.2.7
- 2.2.6
- 2.2.5
- 2.2.4
- 2.2.3
- 2.2.2
- 2.2.1
- 2.2.0
- 2.1.2
- 2.1.1
- 2.1.0
- 2.0.0
- 1.1.0
- 1.0.0
- dev-ns-cleaning-issue
This package is auto-updated.
Last update: 2024-11-22 00:07:22 UTC
README
Templado 5.0 is currently under heavy development
Templado 5.0 - developed in
main
- is, in major parts, a rewrite from Templado 4.x and under current development. If you want to try 5.0 already, please be aware of the fact the current API is subject to change and it is not yet feature complete.
A pragmatic approach to templating for PHP 8.2+
(Use Templado 4.x for PHP >=7.4)
Motivation
Most of today's templating engines mix code for the required rendering logic with HTML markup in one file and require the developers to learn their respective language.
Templado follows a different approach on templating: Being in part inspired by Tempan, Templado relies solely on plain HTML markup. The limited amount of display logic required is contained with the engine and triggered by the view model when it's applied to the Page.
Always ready to preview
As a Templado template is plain HTML, previewing is as easy as opening the HTML file with a browser - example data can and should be included as the engine will clean it up based on the view model upon rendering.
Form handling included
To make form handling even more easy, Templado comes with explicit HTML Form support. Based on supplied Input data, Templado will repopulate the HTML form and even include your CSRF protection code.
Merging of Documents
Documents can be merged based on element ID values to combine multiple fragments - even recursively - into a final document.
Custom transformations, Filters and Serialization
Templado allows for custom transformations, like adding a class to every a
tag and string based replacements upon
serialization. The full serialization can be customized, with some default variants shipping along.