PHPackages                             jp-toolkit/html-helper - 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. jp-toolkit/html-helper

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

jp-toolkit/html-helper
======================

A helper classes based on Laravel Forms, CodeIgniter HTML helper and Yii Framework BaseHtml helper that provides a set of static methods for generating commonly used HTML tags to use in WordPress themes and/or plugins.

v1.3.2(5y ago)026GPL-3.0-or-laterPHPPHP &gt;=7CI failing

Since Apr 18Pushed 5y ago1 watchersCompare

[ Source](https://github.com/jprieton/jp-toolkit-html-helper)[ Packagist](https://packagist.org/packages/jp-toolkit/html-helper)[ Docs](https://github.com/jprieton/jp-toolkit-html-helper/)[ RSS](/packages/jp-toolkit-html-helper/feed)WikiDiscussions master Synced 5d ago

READMEChangelog (6)Dependencies (2)Versions (8)Used By (0)

JP Toolkit HTML Helper
======================

[](#jp-toolkit-html-helper)

A helper classes based on Laravel Forms, CodeIgniter HTML helper and Yii Framework BaseHtml helper that provides a set of static methods for generating commonly used HTML tags to use in WordPress themes and/or plugins.

> **Note**: If your markup is nearly static, it's better to use HTML directly. There's no need to wrap absolutely everything in Html helper class.

Examples
--------

[](#examples)

### Html class

[](#html-class)

The code for generating a tag looks like the following:

```
use JPToolkit\HtmlHelper\Html;

echo Html::tag( 'p', 'Lorem ipsum dolor sit amet', ['class' => 'text-justify'] );
```

The first argument is the tag name. The second one is the content to be enclosed between the start and end tags. The third one is an array of HTML attributes. In this array the key is the name of the attribute (such as `class`, `href` or `target`), and the value is its value. You can also use a query string to set the tag attributes.

The code above will generate the following HTML:

```
Lorem ipsum dolor sit amet
```

### Form class

[](#form-class)

The code for generating a tag looks like the following:

```
use JPToolkit\HtmlHelper\Form;

$attributes   = [
    'name'  => 'username',
    'id'  	=> 'username',
    'value' => '',
    'type'  => 'text'
];
echo Form::input( $attributes );
```

The `$attributes` is an array of HTML attributes. In this array the key is the name of the attribute (such as `class`, `value` or `id`), and the value is its value. You can also use a query string to set the tag attributes.

The code above will generate the following HTML:

```

```

Please read our [Wiki](https://github.com/jprieton/jp-toolkit-html-helper/wiki) for more detailed information, advanced usage and shorthands.

Installing
----------

[](#installing)

#### Manual

[](#manual)

Recommended in most cases.

1. Download the [jp-toolkit-html-helper.zip](https://github.com/jprieton/jp-toolkit-html-helper/releases/latest) file from GitHub
2. In your WordPress admin click *Plugin &gt; Add New &gt; Upload Plugin*.
3. Upload the ZIP file.
4. Activate the plugin.

#### Via Composer

[](#via-composer)

This plugin is also available as [Composer package](https://packagist.org/packages/jp-toolkit/html-helper) and can be installed via Composer from the root of your theme or plugin. Recommended when you want to bundle in your theme or plugin.

```
composer require jp-toolkit/html-helper
```

**Note:**

When is installed via Composer it is necessary to initialize the **shortcodes** and **shorthands** handlers, this code can be placed in your `functions.php` of your theme or the root file of your plugin.

```
use JPToolkit\HtmlHelper\Init as HtmlHelperInit;
new HtmlHelperInit();
```

This code is **only** required when is installed via Composer, if you do not want use these handlers you can skip this step.

Bug tracker?
------------

[](#bug-tracker)

Have a bug? Please create an issue on GitHub at

###  Health Score

26

—

LowBetter than 43% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

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

Recently: every ~60 days

Total

6

Last Release

1976d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1640668?v=4)[Javier Prieto](/maintainers/jprieton)[@jprieton](https://github.com/jprieton)

---

Top Contributors

[![jprieton](https://avatars.githubusercontent.com/u/1640668?v=4)](https://github.com/jprieton "jprieton (26 commits)")

---

Tags

formhtmljp-toolkitwordpresswordpress-developmentwordpress-pluginwordpress-themewordpresshtmlwordpress pluginformwordpress-themewordpress-developmentjp-toolkit

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/jp-toolkit-html-helper/health.svg)

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

###  Alternatives

[laravie/html

HTML and Form Builders for the Laravel Framework

36184.6k4](/packages/laravie-html)[varunsridharan/wp-dependencies

Provides Function To Check if a plugin is active/inactive &amp; function to compare versions.

1032.5k1](/packages/varunsridharan-wp-dependencies)[vluzrmos/collective-html

LaravelCollective Html and Form builder for Lumen.

2523.9k](/packages/vluzrmos-collective-html)[tomjamon/laravel-custom-html

Custom HTML generator for Laravel (Based on LaravelCollective HTML)

1018.6k](/packages/tomjamon-laravel-custom-html)

PHPackages © 2026

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