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

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

valerian/html
=============

Object oriented tool for building HTML documents.

v0.0.3(9y ago)021BSD-3-ClausePHPPHP &gt;=5.6.0

Since Dec 21Pushed 9y ago1 watchersCompare

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

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

Html
====

[](#html)

Object oriented tool for building HTML documents.

Requirements
============

[](#requirements)

Requires PHP 5.6.0 or higher.

Installation
============

[](#installation)

The best way to install valerian/html is using [Composer](http://getcomposer.org/):

```
$ composer require valerian/html
```

Getting Started
===============

[](#getting-started)

Html

```
$element = (new Valerian\Html\Html())
    ->attribute('class', 'foo')
    ->attribute('id', 'bar')
    ->addChild(...)
echo (string) $element;
```

Output:

```

```

Body

```
$element = (new Valerian\Html\Body())
    ->attribute('class', 'foo')
    ->attribute('id', 'bar')
    ->addChild(...)
echo (string) $element;
```

Output:

```

```

Div

```
$element = (new Valerian\Html\Div())
    ->attribute('class', 'foo')
    ->attribute('id', 'bar')
    ->addChild(...)
echo (string) $element;
```

Output:

```

```

Span

```
$element = (new Valerian\Html\Span())
    ->attribute('class', 'foo')
    ->attribute('id', 'bar')
    ->addChild(...)
echo (string) $element;
```

Output:

```

```

Paragraph

```
$element = (new Valerian\Html\Paragraph())
    ->attribute('class', 'foo')
    ->attribute('id', 'bar')
    ->addChild(...)
echo (string) $element;
```

Output:

```

```

Image

```
$element = (new Valerian\Html\Img('image url'))
    ->alt('alt text')
    ->width(100)
    ->height(200)
    ->attribute('class', 'foo')
    ->attribute('id', 'bar')
echo (string) $element;
```

Output:

```

```

Input

```
$input = (new Valerian\Html\Input('text', 'foo'))
    ->value('bar')
    ->attribute('class', 'foo')
    ->attribute('id', 'bar')
echo (string) $input;
```

Output:

```

```

Select

```
$select = (new Valerian\Html\Select('foo'))
    ->addOption(
        (new \Valerian\Html\SelectOption(1, 'Option 1'))
            ->disabled('disabed')
    )
    ->addOption(
        (new \Valerian\Html\SelectOption(2, 'Option 2'))
    )
    ->attribute('class', 'foo')
    ->attribute('id', 'bar')
echo (string) $select;
```

Output:

```

    Option 1
    Option 2

```

Form

```
$input = (new Valerian\Html\Form('#'))
    ->method('GET')
    ->attribute('class', 'foo')
    ->attribute('id', 'bar')
    ->addChild($input)
    ->addChild($select)
echo (string) $input;
```

Output:

```

        Option 1
        Option 2

```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity50

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

Every ~0 days

Total

3

Last Release

3432d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0d73ee96b66127fe961be461082093e06f1e37455f386a0211fab7365cc44fc8?d=identicon)[miroslav-valerian](/maintainers/miroslav-valerian)

---

Top Contributors

[![miroslav-valerian](https://avatars.githubusercontent.com/u/10794336?v=4)](https://github.com/miroslav-valerian "miroslav-valerian (10 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[hesammousavi/bootstrap-v4-rtl

boootstrap4 right to left

99128.1k](/packages/hesammousavi-bootstrap-v4-rtl)[nulpunkt/yesql-php

A clone of the wonderful yesql clojure library, for php

2512.5k](/packages/nulpunkt-yesql-php)

PHPackages © 2026

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