PHPackages                             lamoni/markupbuilder - 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. lamoni/markupbuilder

ActiveLibrary

lamoni/markupbuilder
====================

A PHP class used for building a single-level DOM object using method chaining and dynamic methods

v1.0.0(11y ago)031[1 issues](https://github.com/lamoni/markupbuilder/issues)MITPHPPHP &gt;= 5.4.16

Since Mar 25Pushed 11y agoCompare

[ Source](https://github.com/lamoni/markupbuilder)[ Packagist](https://packagist.org/packages/lamoni/markupbuilder)[ Docs](https://github.com/lamoni/markupbuilder)[ RSS](/packages/lamoni-markupbuilder/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (2)Used By (0)

MarkupBuilder
-------------

[](#markupbuilder)

This class is used for building a single-level DOM object using method chaining and dynamic methods.

Dependencies
------------

[](#dependencies)

- PHP &gt;= 5.4

Considerations
--------------

[](#considerations)

- Implement "Contained" tag creation?
- Remove $elementName, $attributeName, and $attributes properties and instead just pass that data through method arguments?

Examples
--------

[](#examples)

The following code:
-------------------

[](#the-following-code)

```
    $div = new \Lamoni\MarkupBuilder\MarkupBuilder();

    echo $div->divOpen('myIDHere')
                 ->class('myClassHere')
                 ->madeUpAttribute('theValue')
                 ->attribute_with_hyphen('theHyphenValue');

    echo "CONTENT!";

    echo $div->divClose();
```

will generate the following HTML:

```

    Content

```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity58

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.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

4071d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/11b77fa579fae487008ef56c12aea1e891e8be11cb6062fed9b4002a20b58872?d=identicon)[lamoni](/maintainers/lamoni)

---

Top Contributors

[![lamoni](https://avatars.githubusercontent.com/u/5675626?v=4)](https://github.com/lamoni "lamoni (3 commits)")

---

Tags

phphtmldombuildermarkup

### Embed Badge

![Health badge](/badges/lamoni-markupbuilder/health.svg)

```
[![Health](https://phpackages.com/badges/lamoni-markupbuilder/health.svg)](https://phpackages.com/packages/lamoni-markupbuilder)
```

###  Alternatives

[simplehtmldom/simplehtmldom

A fast, simple and reliable HTML document parser for PHP.

1921.3M14](/packages/simplehtmldom-simplehtmldom)[ressio/pharse

Fastest PHP HTML Parser

8478.4k](/packages/ressio-pharse)[epic-64/elem

A fluent, type-safe PHP library for building HTML documents using the DOM

272.9k](/packages/epic-64-elem)[naucon/htmlbuilder

A package for php to generate html markup with object representation but without the overhead of domXML or SimpelXML.

1254.8k2](/packages/naucon-htmlbuilder)

PHPackages © 2026

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