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

ActivePackage

authanram/html
==============

WORK IN PROGRESS

00PHP

Since Mar 19Pushed 3y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (3)Used By (0)

authanram/html
==============

[](#authanramhtml)

Painless html generation.

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

[](#installation)

You can install the package via composer.

```
composer require authanram/html
```

Basic Usage Example
-------------------

[](#basic-usage-example)

Here's an example of how it can be used in a very basic way:

```
use Authanram\Html\Renderer;

$qux = [
    'tag' => 'a',
    'attributes' => [
        'href' => 'https://github.com/authanram',
        'class' => 'text-blue-600',
        'data-anchor' => true,
    ],
    'contents' => [
        'authanram at github.com'
    ],
];

Renderer::renderFromArray($qux);
```

`Renderer::renderFromArray($qux);` will return the following `string`:

```

    authanram at github.com

```

### Nesting

[](#nesting)

```
use Authanram\Html\Renderer;

$qux = [
    'tag' => 'p',
    'contents' => [
        [
            'tag' => 'a',
            'attributes' => [
                'class' => 'text-blue-600',
                'href' => 'https://github.com/authanram',
            ],
            'contents' => [
                [
                    'tag' => 'span',
                    'class' => 'semibold',
                    'contents' => [
                        ['authanram at github.com'],
                    ]
                ],
            ],
        ],
    ],
];

Renderer::renderFromArray($qux);
```

`Renderer::renderFromArray($qux);` will return the following `string`:

```

            authanram at github.com

```

Class Based Usage
-----------------

[](#class-based-usage)

As you can see [here](https://github.com/authanram/html/blob/1e58bf82d16d06dde3b2860ab181cf7ebfb5e5a7/src/Renderer.php#L60), we can achieve the same result using the static method `Authanram\Html\Element::make()`:

```
use Authanram\Html\Element;

Element::make(
    'a',
    [
        'href' => 'https://gitub.com',
        'class' => 'text-blue-600',
    ],
    ['authanram at github.com'],
)->render();
```

Abbreviation Based Usage
------------------------

[](#abbreviation-based-usage)

...

```
use Authanram\Html\Element;

Element::parse('a.text-blue-600[href=https://gitub.com]')
    ->render();
```

Credits
-------

[](#credits)

- [Daniel Seuffer](https://github.com/authanram)
- [and Contributors](https://github.com/authanram/html/graphs/contributors) ❤️

License
-------

[](#license)

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

###  Health Score

15

—

LowBetter than 3% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity30

Early-stage or recently created project

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/39ce69cfcaec5f2934c28c9375c96225bdbb810cf436631fcfc486dcceab14a8?d=identicon)[authanram](/maintainers/authanram)

---

Top Contributors

[![authanram](https://avatars.githubusercontent.com/u/1874088?v=4)](https://github.com/authanram "authanram (67 commits)")

### Embed Badge

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

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

PHPackages © 2026

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