iakio / htmlhelper
Simple secure HtmlHelper
Installs: 43
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 1
Forks: 1
Open Issues: 0
pkg:composer/iakio/htmlhelper
Requires (Dev)
- phpunit/phpunit: 4.1.*
This package is not auto-updated.
Last update: 2025-10-11 20:43:29 UTC
README
Simple secure HtmlHelper.
Features:
- Auto escaping.
- Fluent interface.
Usage:
<?php require 'vendor/autoload.php'; use iakio\htmlhelper\HtmlHelper; $html = new HtmlHelper; echo $html->h1('Hello, World'), "\n"; // instance method // <h1>Hello, World</h1> echo HtmlHelper::h1('Hello, World'), "\n"; // or static method // <h1>Hello, World</h1> echo HtmlHelper::a('set attributes', ['href' => 'http://github.com']), "\n"; // <a href="http://github.com">set attributes</a> echo HtmlHelper::a() ->append('fluent') ->append(' interface') ->attr('href', 'http://github.com'), "\n"; // <a href="http://github.com">fluent interface</a> echo HtmlHelper::span(['Auto <escape>', HtmlHelper::i('& nested tag')]), "\n"; // <span>Auto <escape><i>& nested tag</i></span>