PHPackages                             lukaswhite/html-element - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. lukaswhite/html-element

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

lukaswhite/html-element
=======================

A really simple PHP class for creating HTML elements

033811PHP

Since Aug 16Pushed 7y ago1 watchersCompare

[ Source](https://github.com/lukaswhite/html-element)[ Packagist](https://packagist.org/packages/lukaswhite/html-element)[ RSS](/packages/lukaswhite-html-element/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependenciesVersions (1)Used By (1)

HTML Element
============

[](#html-element)

A *really* simple PHP class for creating HTML elements.

```
$heading = new HtmlElement( 'h2', 'This is a heading' );
$heading->set( 'class', 'is-title' );
print $heading->render( );
// or, because it implements __toString( )
print $heading
```

This will output the following:

```
This is a heading
```

You can also provide another instance when setting content:

```
$span = new HtmlElement( 'span', 'span content' );
$p = new HtmlElement( 'p' );
$p->setContent( $span );
```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity40

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://www.gravatar.com/avatar/f1bd633ffdf0f66a73a288c4edcacfa43d214cd95a53384c6fe5ea4b3554dd9d?d=identicon)[lukaswhite](/maintainers/lukaswhite)

---

Top Contributors

[![lukaswhite](https://avatars.githubusercontent.com/u/999014?v=4)](https://github.com/lukaswhite "lukaswhite (2 commits)")

### Embed Badge

![Health badge](/badges/lukaswhite-html-element/health.svg)

```
[![Health](https://phpackages.com/badges/lukaswhite-html-element/health.svg)](https://phpackages.com/packages/lukaswhite-html-element)
```

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
