PHPackages                             sinevia/php-library-html - 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. sinevia/php-library-html

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

sinevia/php-library-html
========================

PHP Library HTML

v2.3.0(5y ago)297412proprietaryPHPCI failing

Since Jun 23Pushed 3y ago2 watchersCompare

[ Source](https://github.com/Sinevia/php-library-html)[ Packagist](https://packagist.org/packages/sinevia/php-library-html)[ Docs](http://github.com/sinevia/php-library-html)[ RSS](/packages/sinevia-php-library-html/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (10)Dependencies (1)Versions (26)Used By (2)

PHP Library HTML
================

[](#php-library-html)

[![No Dependencies](https://camo.githubusercontent.com/e5650883bec05bec967678c8203c32b160b75c93b5b745c80bd9e6f25eb4a3db/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6e6f2d646570656e64656e636965732d737563636573732e737667)](https://camo.githubusercontent.com/e5650883bec05bec967678c8203c32b160b75c93b5b745c80bd9e6f25eb4a3db/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6e6f2d646570656e64656e636965732d737563636573732e737667)[![Tests](https://github.com/Sinevia/php-library-html/workflows/Test/badge.svg)](https://github.com/Sinevia/php-library-html/workflows/Test/badge.svg)[![Gitpod Ready-to-Code](https://camo.githubusercontent.com/ec0084907bd5b3576af415a1e46cae636fbfa04da6bf9db6296eae3057a189f0/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f476974706f642d52656164792d2d746f2d2d436f64652d626c75653f6c6f676f3d676974706f64)](https://gitpod.io/#https://github.com/Sinevia/php-library-html)

Programatically generate valid HTML.

Introduction
------------

[](#introduction)

This library helps generate valid HTML/XHTML using PHP. It has most of the HTML elements, as well as additional elements like Webpage, BorderLayout, etc.

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

[](#installation)

1. Via Composer

```
composer require sinevia/php-library-html

```

2. Manual Download this folder

Examples
--------

[](#examples)

### 1. Image

[](#1-image)

```
$image = (new \Sinevia\Html\Image)
        ->setUrl('http://help.jpg')->setAlt('Help')
        ->setOnClick('$("#info").toggle()')
        ->toXhtml();

```

### 2. Input

[](#2-input)

```
$inputFirstName = (new \Sinevia\Html\Input)
        ->setName('FirstName')
        ->setValue($firstName)
        ->setPlaceHolder('Your first name')
        ->addClass('form-control')
        ->toXhtml();

```

### 3. Select

[](#3-select)

- Select editor list

```
echo (new Sinevia\Html\Select)
        ->addItems(App\Models\Articles\Article::getEditorList())
        ->setSelectedItem($wysiwyg)
        ->addClass('form-control')
        ->setName('Wysiwyg')
        ->toHtml();

```

- Select Birthday Day/Month/Year

```
$selectBirthDay = (new \Sinevia\Html\Select)
        ->setName('BirthDay')
        ->setSelectedItem($birthDay)
        ->addClass('form-control')
        ->addItem("", "- Select day -")
        ->addItems(array_combine(range(1, 31), range(1, 31)))
        ->setSelectedItem($birthDay)
        ->toXhtml();

$selectBirthMonth = (new \Sinevia\Html\Select)
        ->setName('BirthMonth')
        ->addClass('form-control')
        ->addItem("", "- Select month -")
        ->addItems(array_combine(range(1, 12), array_map(function($v) {
                            return date('F', mktime(0, 0, 0, $v, 1));
                        }, range(1, 12))))
        ->setSelectedItem($birthMonth)
        ->toXhtml();

$selectBirthYear = (new \Sinevia\Html\Select)
        ->setName('BirthYear')
        ->addClass('form-control')
        ->addItem("", "- Select year -")
        ->addItems(array_combine(range(1930, 2020), range(1930, 2020)))
        ->setSelectedItem($birthYear)
        ->toXhtml();

```

### 4. Webpage

[](#4-webpage)

```
$webpage = (new \Sinevia\Html\Webpage)
        ->setTitle('Hello')
        ->addChild('Hello World');
echo $webpage->toHtml();

```

###  Health Score

35

—

LowBetter than 77% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity73

Established project with proven stability

 Bus Factor1

Top contributor holds 94.5% 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

Total

25

Last Release

2173d ago

Major Versions

v0.1.0 → v1.0.02018-08-26

v1.14.0 → v2.0.02020-03-25

### Community

Maintainers

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

---

Top Contributors

[![Sinevia](https://avatars.githubusercontent.com/u/3450815?v=4)](https://github.com/Sinevia "Sinevia (156 commits)")[![lesichkovm](https://avatars.githubusercontent.com/u/7744963?v=4)](https://github.com/lesichkovm "lesichkovm (9 commits)")

---

Tags

phplibraryhtmlsinevia

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/sinevia-php-library-html/health.svg)

```
[![Health](https://phpackages.com/badges/sinevia-php-library-html/health.svg)](https://phpackages.com/packages/sinevia-php-library-html)
```

PHPackages © 2026

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