thipages / quicktag
Quick html tags builder
v0.7.0
2020-07-30 07:21 UTC
Requires (Dev)
This package is auto-updated.
Last update: 2025-03-29 00:37:51 UTC
README
Quick Html tags builder
Installation
composer require thipages\quicktag
Usage of QTag class
Basic usage
Maps are associative arrays mapping tags attributes
// ************* // CONTENT TAGS // ************* QTag::tag ($tag, ...$map)($content) : String QTag::tag ($tag, ...$map1)($content,$map2]) : String // ************* // VOID TAGS // ************* QTag::tag ($tag, ...$map):String
Examples
$blue=['style'=>'color:blue']; $html=QTag::tag('span',$blue)('Hello QTag'); /* <span style="color:blue">Hello QTag</span> */ $html=QTag::tag('input', ['type'=>'num','min'=>2]); /* <input type="num" min="2" /> */
Templating usage - Content tags
QTag::tag ($tag, ...$map1)[($content, ...$map2, true)]n($content, ...$mapN) : String
Examples
$blue=['style'=>'color:blue']; $template=QTag::tag('span',$blue)('Hello QTag', true); $html=$template('...and more"); /* <span style="color:blue">Hello QTag...and more</span> */