maveius / liphte
Lightweight & minimalistic HTML Builder/Generator for PHP
Requires
- php: >=5.6.9
- windwalker/dom: ~2.0
- windwalker/html: ~2.0
Requires (Dev)
- phpunit/phpunit: >=5.7
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-22 21:03:26 UTC
README
Liphte
The HTML test report is published as a plain test-report.html artifact of each Tests workflow run. The pipeline also runs composer audit and fails on any known vulnerability.
Lightweight & minimalistic HTML Builder/Generator (or maybe Template Engine) for PHP
What is liphte ?
It's lightweight and minimalistic wrapper of html or dom builder based on windwalker-dom and windwalker-html, but inspired by projects rudykocur/pyeve and rudykocur/breve which is simplest way to create or generate html from controllers or others php files.
Example:
/** Import **/ use liphte\tags\html\Tag; use liphte\tags\html\Attribute as a; /** In your code (for example controller) **/ $t = Liphte::tag(); $result = $t->table ([ 'style' => 'border: 1px solid #070;' ], [ $t->tr( [ $t->td( a::style( 'border: 1px solid #000;' ), 'Column 1' ), $t->td( a::style( 'border: 1px solid #000;' ), 'Column 2' ) ] ) ] ); echo $result . "\n";
Output:
<table style="border: 1px solid #070;"><tr><td style="border: 1px solid #000;">Column 1</td><td style="border: 1px solid #000;">Column 2</td></tr></table>
Installing Liphte
Composer required:
{
"require": {
"maveius/liphte": "^2.0"
}
}
or
{
"require": {
"maveius/liphte": "dev-master"
}
}
- Add required package to
composer.json - Run
composer updatein your project directory. - Enjoy! Import library and use like in example.
Requirements:
- PHP >= 8.5
windwalker/dom^3.5 (last release line with theHtmlElementAPI; 4.x escapes nested HTML, so it is not a drop-in)
Changelog
-
v2.0 :
- Requires PHP 8.5, PHPUnit 12; sources moved to
src/(PSR-4),Attributesmoved toliphte\tags\html - Fixed
TypeErrorinTagon PHP 8 (method_exists()with an array) - Dropped unused
windwalker/html; added CI pipeline,composer auditand HTML test report
- Requires PHP 8.5, PHPUnit 12; sources moved to
-
v1.0 : 10 June 2015:
- Refactoring code and direcotries structure
-
v0.1 : 6 June 2015:
- Init repository & implement first concept.
Main Developers
Licence
- MIT