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

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

drez/php-html
=============

A class to write Html in PHP

07PHP

Since Sep 30Pushed 5y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

A class to write Html in PHP
============================

[](#a-class-to-write-html-in-php)

I hate HTML! I hate putting multiple language is PHP files. So I use a small class that produces HTML and add some shortcut.

So I write HTML like that:

```
use phpHtml\Html;

$Html = new Html('bootstrap', true);

$Html
    ->jumbotron(null)
        ->addH1("Use HJSON intead of XML for Propel")
        ->addP("This library is part of APIgoat.")
    ->close()
    ->div(null, ['class' => 'card-group'])
        ->div(null, ['class' => 'card'])
            ->div(null, ['class' => 'card-header'])
                ->addSpan("HJSON to Propel XML schema.", ["style" => "display: inline-block;width: 49%;"])
                ->div(null, ["style" => "display: inline-block;width: 50%;text-align: right;"])
                    ->addBut("Convert", ['id' => 'convert', 'type' => 'primary'])
            ->close()
        ->close()
        ->div(null, ['class' => 'card-body'])
            ->addDiv("", ['id' => 'hjson-editor', "style" => "height: 100%; width: 100%"])
        ->close('all', 1)
        ->div(null, ['class' => 'card'])
            ->div(null, ['class' => 'card-header'])
                ->addSpan("HJSON to Propel XML schema.", ["style" => "display: inline-block;width: 49%;"])
                ->div(null, ["style" => "display: inline-block;width: 50%;text-align: right;"])
                ->addBut("Download schema", ['id' => 'download', 'type' => 'primary'])
            ->close()
        ->close()
        ->div(null, ['class' => 'card-body'])
        ->addDiv("", ['id' => 'xml-editor', 'addclass' => 'editor', "style" => "height: 100%; width: 100%"])
    ->close('all');

    $html =  $Html->body(null, ['class' => 'body'])->addContainerFull($Html->getBuffer())->close()->getPage();

```

Features
========

[](#features)

- Easy to add shortcut for the most use tag
- Add classes automatically if needed

Use
===

[](#use)

```
composer require drez/php-html

```

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity32

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://avatars.githubusercontent.com/u/1502671?v=4)[Fred](/maintainers/drez)[@drez](https://github.com/drez)

---

Top Contributors

[![drez](https://avatars.githubusercontent.com/u/1502671?v=4)](https://github.com/drez "drez (10 commits)")

---

Tags

htmlphp

### Embed Badge

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

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

###  Alternatives

[laravel-frontend-presets/vuetify

Laravel 5.5+ Front-end preset for vuetify

8013.4k](/packages/laravel-frontend-presets-vuetify)[bigperson/auto-base-buy

The package allows you to access data through the base car by model

173.6k](/packages/bigperson-auto-base-buy)

PHPackages © 2026

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