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

Abandoned → [aura/html](/?search=aura%2Fhtml)Library[Utility &amp; Helpers](/categories/utility)

jnjxp/html
==========

helpers for html stuff

v0.2.17(11y ago)0572AGPL-3.0PHPPHP &gt;=5.3.0

Since Apr 15Pushed 11y ago1 watchersCompare

[ Source](https://github.com/jnjxp/html)[ Packagist](https://packagist.org/packages/jnjxp/html)[ RSS](/packages/jnjxp-html/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (3)Versions (19)Used By (2)

jnjxp/html : HTML Helpers
=========================

[](#jnjxphtml--html-helpers)

[![Software License](https://camo.githubusercontent.com/9c8d31d8ef52835a16252cd271c257fb3deb7f634e34d2ac8f27c1c66e6c5378/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4147504c2d3931313931312e7376673f7374796c653d666c61742d737175617265)](https://www.gnu.org/licenses/agpl-3.0.html)[![Latest version](https://camo.githubusercontent.com/dc6d60b75d71a82f32e4ce365c9470ea79c903a85bcbfbd8beb2a68814058feb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6a6e6a78702f68746d6c2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/jnjxp/html)[![Build Status](https://camo.githubusercontent.com/93112a0b84bdcae1eed8646790090afc4ad7cae3b09a75e2ea01e88503c0c9e1/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f6a6e6a78702f68746d6c2f6d61737465722e7376673f7374796c653d666c61742d737175617265)](https://travis-ci.org/jnjxp/html)[![Coverage Status](https://camo.githubusercontent.com/3f25c830f3f490020e525561a6e79f579118ea6716a54ef7982416a667ef2809/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f6a6e6a78702f68746d6c2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/jnjxp/html)[![Quality Score](https://camo.githubusercontent.com/02885abf64b7a2e367eda990998deb684d7d7b25370aeb08a720500d7afe9f54/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f6a6e6a78702f68746d6c2e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/jnjxp/html)

**jnjxp\\html** is an extension of [Aura.Html](https://github.com/auraphp/Aura.Html).

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

[](#installation)

```
$ composer require jnjxp/html
```

Usage
-----

[](#usage)

Instantiate helper locator.

```
use Jnjxp\Html\Factory as HtmlFactory;

$helper = (new HtmlFactory())->newInstance();

// example calling the icon helper
$helper->icon('foo');
$helper->icon->__invoke('foo');
$helper('icon','foo');
```

Helpers
-------

[](#helpers)

See the [Aura.Html](https://github.com/auraphp/Aura.Html) documentation ([tag](https://github.com/auraphp/Aura.Html/blob/2.x/README-HELPERS.md) and [input](https://github.com/auraphp/Aura.Html/blob/2.x/README-FORMS.md)) for base functionality.

- [Breadcrumb](#breadcrumb)
- [CacheBust](#cachebust)
- [Icon](#icon)
- [Links](#links)
- [Metas](#metas)
- [Modal](#modal)
- [Scripts](#scripts)
- [Styles](#styles)
- [Title](#title)

### Helpers Usage

[](#helpers-usage)

#### Breadcrumb

[](#breadcrumb)

Create an HTML navigational breadcrumb

```
$helper->breadcrumb(['id' => 'test']);  // (array) optional attributes

// add a single item to be escaped
$helper->breadcrumb()
    ->item('Home', '/', ['class' => 'foo']); // (title, uri, attributes)

// add several items to be escaped
$helper->breadcrumb()->items(
    [ // key as uri value as title or array of attributes with title as first key
        '/' => 'Home',
        '/foo' => [ 'Foo', 'class' => 'foo']
        'Bar' // numeric index, URI defaults to "#"
    ]
);

// add a single raw item not to be escaped
$helper->breadcrumb()->rawItem('Home', '/', ['class' => 'foo']);

// add several raw items not to be escaped
$helper->breadcrumb()->items(
    [
        '/' => 'Home',
        '/foo' => ['Foo', 'class' => 'foo']
        'Bar'
    ]
);
```

Output Example:

```

            Home

            Foo

            Bar

```

#### CacheBust

[](#cachebust)

Get a version suffixed file based on json manifest.

Example manifest (eg located at: `/var/www/build/rev-manifest.json`):

```
{
  "assets/js/app.js": "assets/js/app-a9341845.js",
  "assets/css/style.css": "assets/css/style-ca20fa46.css"
}
```

```
// set path to public root
$helper->cacheBust->setPublic('/var/www');

// returns /build/assets/js/app-a9341845.js
$helper->cacheBust('assets/js/app.js', 'build/rev-manifest.json');

// can set a default manifest as well
$helper->cacheBust->setDefaultManifest('build/rev-manifest.json');
$helper->cacheBust('assets/js/app.js');
```

#### Icon

[](#icon)

Create some markup suitable for styling as an icon (eg. glyphicons or fontawesome)

```
echo $helper->icon('edit');
echo $helper->icon('edit', 'Edit Entry');
echo $helper->icon('edit', true);
```

Outputs:

```

 Edit Entry

 edit
```

#### Links

[](#links)

Links helper. (see [Aura\\Html\\Helper\\Links Documentation](https://github.com/auraphp/Aura.Html/blob/2.x/README-HELPERS.md#links) for core function)

```
$helper->links->icons();
echo $helper->links;

// can pass array to override defaults:
$icons = [
    'apple-touch-icon' => [
        'pattern' => '/assets/ico/apple-touch-icon-%sx%1$s.png',
        'sizes' => [144, 114, 72, 57]
    ],
    'icon' => [
        'pattern' => '/assets/ico/favicon-%sx%1$s.png',
        'sizes' => [192, 96, 32, 16],
        'attr' => ['type' => 'image/png']
    ]
];

$helper->links->icons($icons);
```

Outputs:

```

```

#### Metas

[](#metas)

Add meta tags (see [Aura\\Html\\Helper\\Metas Documentation](https://github.com/auraphp/Aura.Html/blob/2.x/README-HELPERS.md#metas) for core function)

```
$helper->metas()
    ->addProperty('foo', 'bar')
    ->addOpenGraphProperty('foo', 'bar')
    ->charset() // pass arg to override default
    ->compat() // pass arg to override default
    ->description('description here')
    ->loc() // pass arg to override default
    ->robots('noindex, follow') // no arg? defaults to 'index, follow'
    ->url('http://example.com')
    ->viewport() // pass arg to override default
    ->image('/image.png');

echo $helper->metas();
```

Outputs:

```

```

#### Modal

[](#modal)

Bootstrap Modal

```
echo $helper->modal(['attr' => ['id' => 'test']])
    ->setTitle('Test Modal')
    ->setBody('Body Here')
    ->setFooter('Modal Footer')
    ->setButton('Launch', ['class' => 'btn-success']);

// Or...

echo $helper->modal(
    [
        'attr'   => ['id' => 'test'],
        'title'  => 'Test Modal',
        'body'   => 'Body Here',
        'footer' => 'Modal Footer',
        'button' => ['Launch', ['class' => 'btn-sucess']]
    ]
);
```

Outputs:

```

    Launch

                &times;
                Test Modal

                Body Here

                Modal Footer

```

#### Scripts

[](#scripts)

Scripts helper

```
$helper->scripts->bust()
    ->setPublic('/var/www/')
    ->setDefaultManifest('build/rev-manifest.json');

$helper->scripts->bust()->add('assets/js/app.js');

$helper->scripts->addInline('alert("foo")');
$helper->scripts->addEventListener('function(){alert("foo")}');

$helper->scripts->addEventListener(
    'alert(event.type)', // snippet
    'click', // event type
    'document.document.getElementById("test")', // target
    true // wrap snippet in function?
);

$helper->scripts->inlineCaptureStart();
echo 'alert("foo")';
$helper->scripts->captureEnd();

$helper->scripts->eventCaptureStart();
// can take same args as addEventListener
echo 'alert("foo")';
$helper->scripts->captureEnd();

echo $helper->scripts;
```

Outputs:

```

alert("foo")
document.addEventListener("DOMContentLoaded", function(){alert("foo")});
document.document.getElementById("test").addEventListener("click", function(event) { alert(event.type) });
alert("foo")
document.addEventListener("DOMContentLoaded", alert("foo"));
```

#### Styles

[](#styles)

Styles helper (see [Aura\\Html\\Helper\\Styles Documentation](https://github.com/auraphp/Aura.Html/blob/2.x/README-HELPERS.md#styles) for core function)

```
$helper->styles->bust()
    ->setPublic('/var/www/')
    ->setDefaultManifest('build/rev-manifest.json');

$helper->styles->bust()->add('assets/css/style.css');

$helper->styles->addInline('.test{color:red;}');

$helper->styles->inlineCaptureStart();
echo ".test{color:red;}";
$helper->styles->captureEnd();

echo $helper->styles;
```

Outputs:

```

    .test{color:red;}
    .test{color:red;}
```

#### Title

[](#title)

Title helper (see [Aura\\Html\\Helper\\Title Documentation](https://github.com/auraphp/Aura.Html/blob/2.x/README-HELPERS.md#title) for core function)

```
$helper->title
    ->set('Page Title')
    ->setSite('Site Title');

echo $helper->title;
```

Outputs:

```
Page Title

```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity57

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

Total

19

Last Release

4074d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/64baf5fff415327ccc832998afe54b34ac3c621e401f128a9343d4e0b0a3f9e4?d=identicon)[jnj](/maintainers/jnj)

---

Top Contributors

[![jakejohns](https://avatars.githubusercontent.com/u/174708?v=4)](https://github.com/jakejohns "jakejohns (82 commits)")

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

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

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

PHPackages © 2026

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