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

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

flextype-components/html
========================

Html Component contains methods that can be useful when working with HTML.

v1.0.0(8y ago)03.2k1MITPHPPHP ^7.1.3

Since Apr 23Pushed 8y ago1 watchersCompare

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

READMEChangelog (1)DependenciesVersions (2)Used By (1)

Html Component
==============

[](#html-component)

[![version](https://camo.githubusercontent.com/baafa318a1eeddf605532c6e3a264ec6fa7cf790c87e6b1650e577257a19b2aa/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e302e302d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265 "Version")](https://camo.githubusercontent.com/baafa318a1eeddf605532c6e3a264ec6fa7cf790c87e6b1650e577257a19b2aa/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f76657273696f6e2d312e302e302d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)[![MIT License](https://camo.githubusercontent.com/942e017bf0672002dd32a857c95d66f28c5900ab541838c6c664442516309c8a/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d626c75652e7376673f7374796c653d666c61742d737175617265)](https://github.com/flextype-components/html/blob/master/LICENSE)

Html Component contains methods that can be useful when working with HTML.

### Installation

[](#installation)

```
composer require flextype-components/html

```

### Usage

[](#usage)

```
use Flextype\Component\Html\Html;
```

Registers a custom macro.

```
// Registering a Html macro
Html::macro('my_element', function() {
    return '';
});

// Calling a custom Html macro
echo Html::my_element();

// Registering a Html macro with parameters
Html::macro('my_element', function($id = '') {
    return '';
});

// Calling a custom Html macro with parameters
echo Html::my_element('flextype');
```

Convert special characters to HTML entities. All untrusted content
should be passed through this method to prevent XSS injections.

```
echo Html::toText('test');
```

Compiles an array of HTML attributes into an attribute string.
Attributes will be sorted using Html::$attribute\_order for consistency.

```
echo ''.$content.'';
```

Create br tags

```
echo Html::br(2);
```

Create

```
echo Html::nbsp(2);
```

Create an arrow

```
echo Html::arrow('right');
```

Create HTML link anchor.

```
echo Html::anchor('About', 'http://sitename.com/about');
```

Create HTML tag

```
echo Html::heading('Title', 1);
```

Generate document type declarations

```
echo Html::doctype('html5');
```

Create image

```
echo Html::image('data/files/pic1.jpg');
```

Obfuscate an e-mail address to prevent spam-bots from sniffing it.

```
echo Html::email('hello@flextype.org');
```

Obfuscate a string to prevent spam-bots from sniffing it.

This method obfuscate the value, randomly convert each
letter to its entity or hexadecimal representation, keeping a
bot from sniffing the randomly obfuscated letters.

```
echo Html::obfuscate('hello@flextype.org');
```

License
-------

[](#license)

See [LICENSE](https://github.com/flextype-components/html/blob/master/LICENSE)

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity16

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity58

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

Unknown

Total

1

Last Release

2937d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/652557f36367ca6ed585663426c237bf39c4e1b6589b28a20937517bf43b0fe4?d=identicon)[Awilum](/maintainers/Awilum)

---

Top Contributors

[![Awilum](https://avatars.githubusercontent.com/u/477114?v=4)](https://github.com/Awilum "Awilum (2 commits)")

---

Tags

html

### Embed Badge

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

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

###  Alternatives

[spatie/laravel-html

A fluent html builder

8376.4M72](/packages/spatie-laravel-html)[ckeditor/ckeditor

JavaScript WYSIWYG web text editor.

5234.2M75](/packages/ckeditor-ckeditor)[caxy/php-htmldiff

A library for comparing two HTML files/snippets and highlighting the differences using simple HTML.

21520.9M14](/packages/caxy-php-htmldiff)[yajra/laravel-datatables-html

Laravel DataTables HTML builder plugin

2899.6M47](/packages/yajra-laravel-datatables-html)[wa72/htmlpagedom

jQuery-inspired DOM manipulation extension for Symfony's Crawler

3383.9M34](/packages/wa72-htmlpagedom)[tinymce/tinymce

Web based JavaScript HTML WYSIWYG editor control.

1697.5M105](/packages/tinymce-tinymce)

PHPackages © 2026

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