PHPackages                             primalbase/html-tag2 - 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. primalbase/html-tag2

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

primalbase/html-tag2
====================

HTML Tag generator

1.9.6(12y ago)176MITCSS

Since Aug 6Pushed 12y ago1 watchersCompare

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

READMEChangelogDependencies (1)Versions (8)Used By (0)

HTML Tag generator. / HTMLタグジェネレータ
----------------------------------

[](#html-tag-generator--htmlタグジェネレータ)

PHP 5 &gt;= 5.3.0

Support DocType: HTML5, XHTML(XHTML1.0 Transitional), HTML(HTML4)

*サポートするDocType: HTML5, XHTML(XHTML1.0 Transitional), HTML(HTML4)*

### Tag - HTML Tag generate class. / HTMLタグを動的に生成するクラス

[](#tag---html-tag-generate-class--htmlタグを動的に生成するクラス)

@version 1.9.5

### $body\_tag = Tag::body()

[](#body_tag--tagbody)

### echo $body\_tag

[](#echo-body_tag)

or

### echo Tag::body()

[](#echo-tagbody)

> ``

### echo Tag::div(array('class' =&gt; 'span12'))

[](#echo-tagdivarrayclass--span12)

> ``

### echo Tag::div(array('class' =&gt; 'span6'))-&gt;addClass('offset6')

[](#echo-tagdivarrayclass--span6-addclassoffset6)

> ``

### echo Tag::table(Tag::tr(Tag::td('content')))

[](#echo-tagtabletagtrtagtdcontent)

> `content`

### echo Tag::div()-&gt;append(Tag::span(array('class' =&gt; 'label'), 'labeled text'))

[](#echo-tagdiv-appendtagspanarrayclass--label-labeled-text)

> `labeled text`

### echo Tag::create('hoge', array('class' =&gt; 'fuga'))

[](#echo-tagcreatehoge-arrayclass--fuga)

> ``

### echo Tag::a('here')-&gt;href('')

[](#echo-tagahere-hrefhttpwwwgooglecom)

> `here`

### Change doctype.

[](#change-doctype)

```
Tag::$DocType = 'Primalbase\Tag\DocType\Hhtml5';
echo Tag::br() //=>
```

```
Tag::$DocType = 'Primalbase\Tag\DocType\Xhtml';
echo Tag::br() //=>
```

```
Tag::$DocType = 'Primalbase\Tag\DocType\Html4';
echo Tag::br() //=>
```

TagNodes - HTML Tag list. / 兄弟関係のタグオブジェクトを格納するクラス
-------------------------------------------------

[](#tagnodes---html-tag-list--兄弟関係のタグオブジェクトを格納するクラス)

@version 1.9.5

### echo TagNodes::create()-&gt;append(Tag::hr())-&gt;append(Tag::br())

[](#echo-tagnodescreate-appendtaghr-appendtagbr)

``

### echo TagNodes::create('hoge fuga')

[](#echo-tagnodescreatehoge-fuga)

`hoge fuga`

Plain - For Escaped HTML append to Tag and TagNods. / HTMLコードをエスケープせずに追加するためのクラス
--------------------------------------------------------------------------------

[](#plain---for-escaped-html-append-to-tag-and-tagnods--htmlコードをエスケープせずに追加するためのクラス)

@version 1.0.0

Other Examples.
---------------

[](#other-examples)

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community7

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 ~17 days

Recently: every ~3 days

Total

7

Last Release

4561d ago

### Community

Maintainers

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

---

Top Contributors

[![primalbase](https://avatars.githubusercontent.com/u/703690?v=4)](https://github.com/primalbase "primalbase (88 commits)")

---

Tags

phphtmltag

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/primalbase-html-tag2/health.svg)

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

###  Alternatives

[christianklisch/slim-minify

Minify html output in slim framework

3831.9k1](/packages/christianklisch-slim-minify)[artem_c/emmet

emmet implementation for php

141.8k](/packages/artem-c-emmet)

PHPackages © 2026

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