nijhof/html-builder

Typed HTML builder for PHP.

Maintainers

Package info

gitlab.com/nijhof/html-builder

Issues

pkg:composer/nijhof/html-builder

Transparency log

Statistics

Installs: 7

Dependents: 0

Suggesters: 0

Stars: 0

v0.1.0 2026-08-10 23:34 UTC

This package is not auto-updated.

Last update: 2026-08-11 23:08:05 UTC


README

Typed HTML builder for PHP.

HTML Builder provides small value objects and element classes for constructing escaped HTML in PHP code. It focuses on explicit element types, typed attributes, and safe text rendering.

Requirements

  • PHP 8.3 or higher

Installation

composer require nijhof/html-builder

Example

<?php

declare(strict_types=1);

use Nijhof\Html\Elements\Div;
use Nijhof\Html\Text;

echo Div::of(Text::of('<content>'))->render();

Output:

<div>&lt;content&gt;</div>

Development

composer install
composer analyse
composer test

License

This package is licensed under the MIT License.