Download the PHP package jp-toolkit/html-helper without Composer
On this page you can find all versions of the php package jp-toolkit/html-helper. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download jp-toolkit/html-helper
More information about jp-toolkit/html-helper
Files in jp-toolkit/html-helper
Package html-helper
Short Description 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.
License GPL-3.0-or-later
Homepage https://github.com/jprieton/jp-toolkit-html-helper/
Informations about the package 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
Html class
The code for generating a tag looks like the following:
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:
Form class
The code for generating a tag looks like the following:
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 for more detailed information, advanced usage and shorthands.
Installing
Manual
Recommended in most cases.
- Download the jp-toolkit-html-helper.zip file from GitHub
- In your WordPress admin click Plugin > Add New > Upload Plugin.
- Upload the ZIP file.
- Activate the plugin.
Via Composer
This plugin is also available as Composer package 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.
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.
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?
Have a bug? Please create an issue on GitHub at https://github.com/jprieton/jp-toolkit-html-helper/issues