PHPackages                             fixmind/phptohtml - 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. [Templating &amp; Views](/categories/templating)
4. /
5. fixmind/phptohtml

ActiveLibrary[Templating &amp; Views](/categories/templating)

fixmind/phptohtml
=================

Fast and easy html generator.

1.0.2(6y ago)034MITPHPPHP &gt;=5.3

Since Jul 10Pushed 6y agoCompare

[ Source](https://github.com/fixmind/phptohtml)[ Packagist](https://packagist.org/packages/fixmind/phptohtml)[ Docs](https://github.com/fixmind/phptohtml)[ RSS](/packages/fixmind-phptohtml/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (2)Dependencies (1)Versions (3)Used By (0)

Html Generator
==============

[](#html-generator)

```
// EXAMPLE 01
echo Html::ul()->li('first point')->getParent()->li('second point');

//
//     first point
//     second point
//

// EXAMPLE 02
echo Html::div()->h1('title')->addId('title')->getParent()
                ->p('just text')->addClass('normal')->addStyle(['color' => 'red']);
//
//     title
//     just text
//

// EXAMPLE 03
$html = Html::div()->addClass('box')
                    ->ul()
                        ->li('first')->getParent()
                        ->li('second')->getParent()
                        ->li('third')->getParent()
                    ->getFirst(2)
                        ->ul()
                            ->li('subFirst')->getParent()
                            ->li('subSecond');
echo $html;

//
//
//      first
//
//          second
//
//              subFirst
//              subSecond
//
//
//      third
//
//
```

Use Selector to modified
========================

[](#use-selector-to-modified)

```
// EXAMPLE 01
// $html from previous example
$html->selectorFirst('ul ul')->addClass('sub');
$html->selectorLast('ul ul li')->addId('subLastId');
echo $html;

//
//
//         first
//         second
//
//                 subFirst
//                 subSecond
//
//
//         third
//
//

// EXAMPLE 02
$html->selectorFirst('ul.sub')->li('subThird');
$html->selectorFirst('#subLastId')->addText('!!!');
echo $html;

//
//
//         first
//         second
//
//                 subFirst
//                 subSecond!!!
//                 subThird
//
//
//         third
//
//

// EXAMPLE 03
foreach($html->selector('ul') as $ul)
{
    $ul->addClass('myUl');
}
echo $html;

//
//
//         first
//         second
//
//                 subFirst
//                 subSecond!!!
//                 subThird
//
//
//         third
//
//
```

Show part of HTML
=================

[](#show-part-of-html)

```
// EXAMPLE 01
// $html from previous example
echo $html->selectorFirst('ul.sub')->render();

//
//     subFirst
//     subSecond!!!
//     subThird
//
```

###  Health Score

25

—

LowBetter than 36% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity55

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 ~55 days

Total

2

Last Release

2491d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/22333085?v=4)[Michał Barcikowski](/maintainers/fixmind)[@fixmind](https://github.com/fixmind)

---

Top Contributors

[![fixmind](https://avatars.githubusercontent.com/u/22333085?v=4)](https://github.com/fixmind "fixmind (11 commits)")

---

Tags

generatorhtmlselectorphphtmlphp2htmlphpToHtmlphpManageHtml

### Embed Badge

![Health badge](/badges/fixmind-phptohtml/health.svg)

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

###  Alternatives

[phpoffice/phpword

PHPWord - A pure PHP library for reading and writing word processing documents (OOXML, ODF, RTF, HTML, PDF)

7.6k37.4M220](/packages/phpoffice-phpword)[latte/latte

☕ Latte: the intuitive and fast template engine for those who want the most secure PHP sites. Introduces context-sensitive escaping.

1.3k16.0M750](/packages/latte-latte)[twig/string-extra

A Twig extension for Symfony String

22149.2M204](/packages/twig-string-extra)[exercise/htmlpurifier-bundle

HTMLPurifier integration for your Symfony project

27611.8M19](/packages/exercise-htmlpurifier-bundle)[twig/markdown-extra

A Twig extension for Markdown

12115.5M117](/packages/twig-markdown-extra)[laminas/laminas-view

Fast and type safe HTML templating library with a flexible plugin system supporting multistep template composition

7527.7M261](/packages/laminas-laminas-view)

PHPackages © 2026

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