hadleen/htmldom

Lightweight enhancement layer for PHP DOMDocument and DOMElement.

Installs: 1

Dependents: 0

Suggesters: 0

Security: 0

Stars: 0

Forks: 0

pkg:composer/hadleen/htmldom

dev-main 2025-12-03 20:35 UTC

This package is not auto-updated.

Last update: 2026-01-01 13:46:31 UTC


README

hadleen/htmldom is a lightweight enhancement layer over PHP’s built-in DOMDocument and DOMElement.

It provides:

  • HtmlDOM — an extended DOMDocument with automatic registration of HtmlElement
  • HtmlElement — an extended DOMElement offering:
    • HTML fragment insertion (insertById, insertByName, insertByTagName, insertByAttribute)
    • content manipulation (appendContent, prependContent)
    • DOM querying shortcuts
    • reading & modifying HTML with innerHTML() and outerHTML()
    • safe HTML fragment importing with automatic wrapper unwrapping

Packagist Version PHP Version License

This library is intentionally small, dependency-free, and designed for general-purpose PHP applications needing robust DOM utilities.

Installation

composer require hadleen/htmldom