PHPackages                             krzysztofzylka/html-generator - 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. krzysztofzylka/html-generator

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

krzysztofzylka/html-generator
=============================

HTML generator

2.0.6(2y ago)11.8k↑730.8%3MITPHPPHP &gt;=7.4

Since Jan 2Pushed 2y ago1 watchersCompare

[ Source](https://github.com/krzysztofzylka/HtmlGenerator)[ Packagist](https://packagist.org/packages/krzysztofzylka/html-generator)[ RSS](/packages/krzysztofzylka-html-generator/feed)WikiDiscussions main Synced 3w ago

READMEChangelog (10)Dependencies (1)Versions (11)Used By (3)

HtmlGenerator
=============

[](#htmlgenerator)

Html generator in PHP

Usage
=====

[](#usage)

Static create tag
-----------------

[](#static-create-tag)

```
echo \Krzysztofzylka\HtmlGenerator\HtmlGenerator::createTag('div')
```

or

```
echo \Krzysztofzylka\HtmlGenerator\HtmlGenerator::createTag(
    'div',
    'content'
)
```

or

```
echo \Krzysztofzylka\HtmlGenerator\HtmlGenerator::createTag(
    'div',
    'content',
    'classes'
)
```

or

```
echo \Krzysztofzylka\HtmlGenerator\HtmlGenerator::createTag(
    'div',
    'content',
    'classes',
    ['attributes' => 'value']
)
```

Create tag
----------

[](#create-tag)

```
echo new \Krzysztofzylka\HtmlGenerator\HtmlGenerator('div');
```

Methods
-------

[](#methods)

### Set content

[](#set-content)

```
echo (new \Krzysztofzylka\HtmlGenerator\HtmlGenerator('div'))
    ->setContent('content')
```

### Get content

[](#get-content)

```
echo (new \Krzysztofzylka\HtmlGenerator\HtmlGenerator('div'))
    ->getContent()
```

### Append content

[](#append-content)

```
echo (new \Krzysztofzylka\HtmlGenerator\HtmlGenerator('div'))
    ->appendContent('append content')
```

### Add attributes

[](#add-attributes)

```
echo (new \Krzysztofzylka\HtmlGenerator\HtmlGenerator('div'))
    ->addAttributes(['id' => 'div-id', 'class' => 'classes'])
```

### Add attribute

[](#add-attribute)

```
echo (new \Krzysztofzylka\HtmlGenerator\HtmlGenerator('div'))
    ->addAttribute('id', 'div-id')
```

### Get attribute

[](#get-attribute)

```
echo (new \Krzysztofzylka\HtmlGenerator\HtmlGenerator('div'))
    ->getAttribute('id')
```

### Append string to attribute

[](#append-string-to-attribute)

```
echo (new \Krzysztofzylka\HtmlGenerator\HtmlGenerator('div'))
    ->appendAttribute('class', 'next_class')
```

### Remove attribute

[](#remove-attribute)

```
echo (new \Krzysztofzylka\HtmlGenerator\HtmlGenerator('div'))
    ->removeAttribute('class')
```

### Add id attribute

[](#add-id-attribute)

```
echo (new \Krzysztofzylka\HtmlGenerator\HtmlGenerator('div'))
    ->setId('div-id')
```

### Add name attribute

[](#add-name-attribute)

```
echo (new \Krzysztofzylka\HtmlGenerator\HtmlGenerator('input'))
    ->setName('input-name')
```

### Add class attribute

[](#add-class-attribute)

```
echo (new \Krzysztofzylka\HtmlGenerator\HtmlGenerator('div'))
    ->setClass('class')
```

###  Health Score

29

—

LowBetter than 57% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity22

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity52

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 90.9% 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 ~44 days

Recently: every ~14 days

Total

10

Last Release

874d ago

Major Versions

1.0.2 → 2.0.02023-11-08

### Community

Maintainers

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

---

Top Contributors

[![krzysztofzylka](https://avatars.githubusercontent.com/u/41385342?v=4)](https://github.com/krzysztofzylka "krzysztofzylka (20 commits)")[![krzysztofzylka-wins](https://avatars.githubusercontent.com/u/291765431?v=4)](https://github.com/krzysztofzylka-wins "krzysztofzylka-wins (2 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/krzysztofzylka-html-generator/health.svg)

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

###  Alternatives

[mhujer/jms-serializer-uuid

Uuid serializer and deserializer for JMS Serializer library

291.2M4](/packages/mhujer-jms-serializer-uuid)

PHPackages © 2026

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