PHPackages                             umbrella/tag-builder - 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. umbrella/tag-builder

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

umbrella/tag-builder
====================

TagBuilder is a component to help you to build html tags

v1.0.5(11y ago)023.1k1MITPHP

Since Jan 23Pushed 11y ago5 watchersCompare

[ Source](https://github.com/umbrellaTech/TagBuilder)[ Packagist](https://packagist.org/packages/umbrella/tag-builder)[ RSS](/packages/umbrella-tag-builder/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (8)Dependencies (1)Versions (9)Used By (0)

TagBuilder
==========

[](#tagbuilder)

[![Build Status](https://camo.githubusercontent.com/d2ec4bfb5dea8dd9d6b065e7fb22649938690d26de59878153a4e9c059f7edf8/687474703a2f2f696d672e736869656c64732e696f2f7472617669732f756d6272656c6c61546563682f5461674275696c6465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/umbrellaTech/TagBuilder)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/f4a507c9029af5ce0c3b52adb28ca71de4862ae6d7c52a6f1f295443c6cb572b/687474703a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f756d6272656c6c61546563682f5461674275696c6465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/umbrellaTech/TagBuilder/)[![Code Coverage](https://camo.githubusercontent.com/5bfd27faaf94e174f84719d7db8fcd74671f65769ac7814638cc5be8d20a00e5/687474703a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f756d6272656c6c61546563682f5461674275696c6465722e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/umbrellaTech/TagBuilder/)[![Latest Stable Version](https://camo.githubusercontent.com/98ae5e3f15800cd0d497d2cd8393376f8f7942aabee94d00946c43ad6b374cb0/687474703a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f756d6272656c6c612f7461672d6275696c6465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/umbrella/tag-builder)[![Downloads](https://camo.githubusercontent.com/0f972e2fdaa7d1adbf8d6d0464d591ec2add138ca1254864ecdf73d5e06643e0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f756d6272656c6c612f7461672d6275696c6465722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/umbrella/tag-builder)

[![SensioLabsInsight](https://camo.githubusercontent.com/3ce2020329eabde3c2365b0e6b76eedc7339fc1c29aa8c22f588a5440ef258b3/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f66316632626137322d343834622d343838302d613634652d3139646666306639346164622f736d616c6c2e706e67)](https://insight.sensiolabs.com/projects/f1f2ba72-484b-4880-a64e-19dff0f94adb)

What is it?
-----------

[](#what-is-it)

TagBuilder is a component to help you to build html tags. But why use it to render tags instead of just write them? Well the tag builder sets a pattern of how we need to handle html elements, this avoids html errors and copy and paste code.

Install
-------

[](#install)

```
{
    "require": {
        "umbrella/tag-builder": "~1.0"
    }
}
```

Usage
-----

[](#usage)

Build a link tag.

```
  $linkTag = new \Umbrella\TagBuilder\TagBuilder('a');

  //Adds a href attribute to the tag
  $linkTag->mergeAttribute('href', '#');

  //Adds a css class to the tag
  $linkTag->addCssClass('your-custom-css-class');

  //Adds a text or a html to some tag
  $linkTag->setInnerHtml('Your link text');

  //Renders the tag...
  echo $linkTag->toString(\Umbrella\TagBuilder\TagRenderMode::NORMAL);

  // ... or render like this
  echo $linkTag;

  //Both will print Your link text
```

We have many render modes available like:

```
\Umbrella\TagBuilder\TagRenderMode::NORMAL

\Umbrella\TagBuilder\TagRenderMode::START_TAG

\Umbrella\TagBuilder\TagRenderMode::END_TAG

\Umbrella\TagBuilder\TagRenderMode::SELF_CLOSING
```

Testing
-------

[](#testing)

```
$ phpunit
```

Contributing
------------

[](#contributing)

Please see [CONTRIBUTING](https://github.com/umbrellaTech/TagBuilder/blob/master/CONTRIBUTING.md) for details.

Credits
-------

[](#credits)

- [italolelis](https://github.com/italolelis)
- [All Contributors](https://github.com/umbrellaTech/TagBuilder/contributors)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](https://github.com/umbrellaTech/TagBuilder/blob/master/LICENSE) for more information.

###  Health Score

33

—

LowBetter than 75% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity68

Established project with proven stability

 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

Every ~31 days

Recently: every ~7 days

Total

8

Last Release

4274d ago

Major Versions

v0.2-beta → v1.0.02014-04-04

### Community

Maintainers

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

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

---

Top Contributors

[![italolelis](https://avatars.githubusercontent.com/u/1108049?v=4)](https://github.com/italolelis "italolelis (9 commits)")

### Embed Badge

![Health badge](/badges/umbrella-tag-builder/health.svg)

```
[![Health](https://phpackages.com/badges/umbrella-tag-builder/health.svg)](https://phpackages.com/packages/umbrella-tag-builder)
```

###  Alternatives

[kaufmanndigital/gdpr-cookieconsent

A ready-to-run package, that integrates an advanced cookie consent banner into your Neos CMS site.

2540.7k](/packages/kaufmanndigital-gdpr-cookieconsent)[selective/transformer

A strictly typed array transformer with dot-access, fluent interface and filters.

3817.8k1](/packages/selective-transformer)

PHPackages © 2026

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