icetea/icedom

PHP pure and simple VDOM

Fund package maintenance!
khanhicetea

Installs: 8

Dependents: 1

Suggesters: 0

Security: 0

Stars: 0

Watchers: 0

Forks: 0

Open Issues: 1

pkg:composer/icetea/icedom

1.0.0 2025-11-02 12:03 UTC

This package is auto-updated.

Last update: 2025-12-24 11:16:12 UTC


README

Latest Version on Packagist Tests Total Downloads

IceDOM is a pure PHP library for building HTML documents using a Virtual DOM-like approach. Write HTML in PHP with a fluent, type-safe API—no templates required. All content is automatically escaped to prevent XSS attacks.

Key Features

  • 🔒 Automatic XSS Protection - All content is escaped by default
  • 🎯 Type-Safe - Full IDE autocomplete and type hints
  • 🔄 Virtual DOM-like - Build HTML using PHP objects and methods
  • 🎨 Fluent API - Chain methods for clean, readable code
  • 🚀 Zero Dependencies - Pure PHP, no external libraries
  • 📦 150+ HTML Tags - All standard HTML5 elements included

Quick Example

use function IceTea\IceDOM\{_div, _h1, _p, _button};

$card = _div(['class' => 'card'], [
    _h1('Welcome to IceDOM'),
    _p('Build HTML with PHP, fluently and safely.'),
    _button(['class' => 'btn-primary'], 'Get Started'),
]);

echo $card;
// Output: <div class="card"><h1>Welcome to IceDOM</h1>...</div>

Installation

You can install the package via composer:

composer require icetea/icedom

Usage

Read full usage document here : Usage

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

Contributing

Please see CONTRIBUTING for details.

Security Vulnerabilities

Please review our security policy on how to report security vulnerabilities.

Credits

  • Ideas, Write Core Classes, Review Docs - Tests : KhanhIceTea
  • PHPDocs, Tests : LLMs (because it writes these better and faster than me)
  • All Contributors

License

The MIT License (MIT). Please see License File for more information.