PHPackages                             derxen/simple-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. derxen/simple-html-element

ActivePhp-class[Utility &amp; Helpers](/categories/utility)

derxen/simple-html-element
==========================

Handle HTML elements as an object with optional nodes

1251PHP

Since May 4Pushed 10y ago1 watchersCompare

[ Source](https://github.com/derxen/SimpleHtmlElement)[ Packagist](https://packagist.org/packages/derxen/simple-html-element)[ RSS](/packages/derxen-simple-html-element/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependenciesVersions (1)Used By (0)

SimpleHtmlElement
=================

[](#simplehtmlelement)

Handle HTML elements as an object with optional nodes

Installation
------------

[](#installation)

### Composer

[](#composer)

You can use SimpleHtmlElement by putting the following line into your composer.json

```
    {
        "require": {
            "derxen/simple-html-element": "~1.0"
        }
    }

```

And make sure you load the class within you PHP code or use the Composer Autoloader

Documentation
-------------

[](#documentation)

SimpleHtmlElement has been made to make your work easier. Here is an example:

Create html root.

```
$html       = new derxen\SimpleHtmlElement();

```

We define some table headers.

```
$headers    = ['publish date', 'title', 'author'];

```

We fetch some table data.

```
$data       = [];
$data[]     = ['05-03-2016', 'A great book', 'Sam Wilson'];
$data[]     = ['08-04-2016', 'Another great book', 'Jane Fisscher'];
$data[]     = ['11-01-2016', 'The greatest book', 'Dan Morris'];

```

Let us create a new table. `If you give an array as property, SimpleHtmlElement will handle the property as attributes`

```
$table      = $html->table(['method' => 'post']);

```

Now we add the table headers.

```
foreach($headers as $th) {
    $table->th($th);
}

```

Now we add the table rows with content. `If you give a string as property, SimpleHtmlElement will handle the property as content`

```
foreach($data as $cols) {
    $tr = $table->tr();
    foreach($cols as $td) {
        $tr->td($td);
    }
}

```

We could set some extra attributes to the table.

```
$table->setAttribute(['action' => '/handleform']);

```

Our table is ready. Now we render the table

```
echo $table->write();

```

Or We can just do:

```
echo $table;

```

###  Health Score

21

—

LowBetter than 18% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity41

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://avatars.githubusercontent.com/u/4199375?v=4)[Dinand Derksen](/maintainers/derxen)[@derxen](https://github.com/derxen)

---

Top Contributors

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

### Embed Badge

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

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

###  Alternatives

[humanmade/workflows

Workflow management for WordPress, an extensible event and notification system.

106148.9k4](/packages/humanmade-workflows)

PHPackages © 2026

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