thipages /
快速HTML标签构建器
v0.7.0
2020-07-30 07:21 UTC
Requires (Dev)
This package is auto-updated.
Last update: 2024-09-29 03:31:20 UTC
README
快速HTML标签构建器
安装
composer require thipages\quicktag
QTag类的使用
基本使用
映射是关联数组,用于映射标签属性
// ************* // CONTENT TAGS // ************* QTag::tag ($tag, ...$map)($content) : String QTag::tag ($tag, ...$map1)($content,$map2]) : String // ************* // VOID TAGS // ************* QTag::tag ($tag, ...$map):String
示例
$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" /> */
模板使用 - 内容标签
QTag::tag ($tag, ...$map1)[($content, ...$map2, true)]n($content, ...$mapN) : String
示例
$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> */