Html
API reference › HTML › Html
Provides curated static factory methods for the most commonly used HTML elements.
Every factory returns a fluent element instance; Html::el() renders a one-off element string instead.
See also: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements (Html for the low-level tag renderers.).
Methods
Section titled “Methods”| Method | Description | Defined by |
|---|---|---|
a() static | Returns a new A instance for the HTML <a> element. | Html |
article() static | Returns a new Article instance for the HTML <article> element. | Html |
button() static | Returns a new Button instance for the HTML <button> element. | Html |
div() static | Returns a new Div instance for the HTML <div> element. | Html |
el() static | Returns a rendered HTML element string for a one-off tag. | Html |
em() static | Returns a new Em instance for the HTML <em> element. | Html |
footer() static | Returns a new Footer instance for the HTML <footer> element. | Html |
form() static | Returns a new Form instance for the HTML <form> element. | Html |
h1() static | Returns a new H1 instance for the HTML <h1> element. | Html |
h2() static | Returns a new H2 instance for the HTML <h2> element. | Html |
h3() static | Returns a new H3 instance for the HTML <h3> element. | Html |
h4() static | Returns a new H4 instance for the HTML <h4> element. | Html |
h5() static | Returns a new H5 instance for the HTML <h5> element. | Html |
h6() static | Returns a new H6 instance for the HTML <h6> element. | Html |
header() static | Returns a new Header instance for the HTML <header> element. | Html |
hr() static | Returns a new Hr instance for the HTML <hr> element. | Html |
i() static | Returns a new I instance for the HTML <i> element. | Html |
img() static | Returns a new Img instance for the HTML <img> element. | Html |
label() static | Returns a new Label instance for the HTML <label> element. | Html |
li() static | Returns a new Li instance for the HTML <li> element. | Html |
main() static | Returns a new Main instance for the HTML <main> element. | Html |
nav() static | Returns a new Nav instance for the HTML <nav> element. | Html |
ol() static | Returns a new Ol instance for the HTML <ol> element. | Html |
option() static | Returns a new Option instance for the HTML <option> element. | Html |
p() static | Returns a new P instance for the HTML <p> element. | Html |
section() static | Returns a new Section instance for the HTML <section> element. | Html |
select() static | Returns a new Select instance for the HTML <select> element. | Html |
span() static | Returns a new Span instance for the HTML <span> element. | Html |
strong() static | Returns a new Strong instance for the HTML <strong> element. | Html |
table() static | Returns a new Table instance for the HTML <table> element. | Html |
td() static | Returns a new Td instance for the HTML <td> element. | Html |
textarea() static | Returns a new TextArea instance for the HTML <textarea> element. | Html |
th() static | Returns a new Th instance for the HTML <th> element. | Html |
tr() static | Returns a new Tr instance for the HTML <tr> element. | Html |
ul() static | Returns a new Ul instance for the HTML <ul> element. | Html |
Method details
Section titled “Method details”public static function a(): UIAwesome\Html\Palpable\AReturns a new A instance for the HTML <a> element.
Returns
UIAwesome\Html\Palpable\A: New <a> element instance.
article()
Section titled “article() ”public static function article(): UIAwesome\Html\Sectioning\ArticleReturns a new Article instance for the HTML <article> element.
Returns
UIAwesome\Html\Sectioning\Article: New <article> element instance.
button()
Section titled “button() ”public static function button(): UIAwesome\Html\Form\ButtonReturns a new Button instance for the HTML <button> element.
Returns
UIAwesome\Html\Form\Button: New <button> element instance.
div()
Section titled “div() ”public static function div(): UIAwesome\Html\Flow\DivReturns a new Div instance for the HTML <div> element.
Returns
UIAwesome\Html\Flow\Div: New <div> element instance.
public static function el(string $tag, mixed[] $attributes = [], string|Stringable $content = ''): stringReturns a rendered HTML element string for a one-off tag.
Resolves the tag kind from the library tag enumerations and dispatches to the matching renderer: void tags render without content, inline tags render without surrounding line breaks, and every other tag renders as a block.
Content is encoded with Encode::content() and attribute values with
Encode::value(), so untrusted input never reaches the output unescaped.
Parameters
| Parameter | Type | Description |
|---|---|---|
$tag | string | Tag name to render. |
$attributes | mixed[] | Associative array of HTML attributes. |
$content | string|Stringable | Content to be rendered inside the tag. Ignored for void tags. |
Returns
string: Rendered HTML element string.
Throws
InvalidArgumentException: If the tag name is not a known HTML tag.
public static function em(): UIAwesome\Html\Phrasing\EmReturns a new Em instance for the HTML <em> element.
Returns
UIAwesome\Html\Phrasing\Em: New <em> element instance.
footer()
Section titled “footer() ”public static function footer(): UIAwesome\Html\Root\FooterReturns a new Footer instance for the HTML <footer> element.
Returns
UIAwesome\Html\Root\Footer: New <footer> element instance.
form()
Section titled “form() ”public static function form(): UIAwesome\Html\Form\FormReturns a new Form instance for the HTML <form> element.
Returns
UIAwesome\Html\Form\Form: New <form> element instance.
public static function h1(): UIAwesome\Html\Heading\H1Returns a new H1 instance for the HTML <h1> element.
Returns
UIAwesome\Html\Heading\H1: New <h1> element instance.
public static function h2(): UIAwesome\Html\Heading\H2Returns a new H2 instance for the HTML <h2> element.
Returns
UIAwesome\Html\Heading\H2: New <h2> element instance.
public static function h3(): UIAwesome\Html\Heading\H3Returns a new H3 instance for the HTML <h3> element.
Returns
UIAwesome\Html\Heading\H3: New <h3> element instance.
public static function h4(): UIAwesome\Html\Heading\H4Returns a new H4 instance for the HTML <h4> element.
Returns
UIAwesome\Html\Heading\H4: New <h4> element instance.
public static function h5(): UIAwesome\Html\Heading\H5Returns a new H5 instance for the HTML <h5> element.
Returns
UIAwesome\Html\Heading\H5: New <h5> element instance.
public static function h6(): UIAwesome\Html\Heading\H6Returns a new H6 instance for the HTML <h6> element.
Returns
UIAwesome\Html\Heading\H6: New <h6> element instance.
header()
Section titled “header() ”public static function header(): UIAwesome\Html\Root\HeaderReturns a new Header instance for the HTML <header> element.
Returns
UIAwesome\Html\Root\Header: New <header> element instance.
public static function hr(): UIAwesome\Html\Flow\HrReturns a new Hr instance for the HTML <hr> element.
Returns
UIAwesome\Html\Flow\Hr: New <hr> element instance.
public static function i(): UIAwesome\Html\Phrasing\IReturns a new I instance for the HTML <i> element.
Returns
UIAwesome\Html\Phrasing\I: New <i> element instance.
img()
Section titled “img() ”public static function img(): UIAwesome\Html\Embedded\ImgReturns a new Img instance for the HTML <img> element.
Returns
UIAwesome\Html\Embedded\Img: New <img> element instance.
label()
Section titled “label() ”public static function label(): UIAwesome\Html\Phrasing\LabelReturns a new Label instance for the HTML <label> element.
Returns
UIAwesome\Html\Phrasing\Label: New <label> element instance.
public static function li(): UIAwesome\Html\List\LiReturns a new Li instance for the HTML <li> element.
Returns
UIAwesome\Html\List\Li: New <li> element instance.
main()
Section titled “main() ”public static function main(): UIAwesome\Html\Flow\MainReturns a new Main instance for the HTML <main> element.
Returns
UIAwesome\Html\Flow\Main: New <main> element instance.
nav()
Section titled “nav() ”public static function nav(): UIAwesome\Html\Sectioning\NavReturns a new Nav instance for the HTML <nav> element.
Returns
UIAwesome\Html\Sectioning\Nav: New <nav> element instance.
public static function ol(): UIAwesome\Html\List\OlReturns a new Ol instance for the HTML <ol> element.
Returns
UIAwesome\Html\List\Ol: New <ol> element instance.
option()
Section titled “option() ”public static function option(): UIAwesome\Html\Form\OptionReturns a new Option instance for the HTML <option> element.
Returns
UIAwesome\Html\Form\Option: New <option> element instance.
public static function p(): UIAwesome\Html\Flow\PReturns a new P instance for the HTML <p> element.
Returns
UIAwesome\Html\Flow\P: New <p> element instance.
section()
Section titled “section() ”public static function section(): UIAwesome\Html\Sectioning\SectionReturns a new Section instance for the HTML <section> element.
Returns
UIAwesome\Html\Sectioning\Section: New <section> element instance.
select()
Section titled “select() ”public static function select(): UIAwesome\Html\Form\SelectReturns a new Select instance for the HTML <select> element.
Returns
UIAwesome\Html\Form\Select: New <select> element instance.
span()
Section titled “span() ”public static function span(): UIAwesome\Html\Phrasing\SpanReturns a new Span instance for the HTML <span> element.
Returns
UIAwesome\Html\Phrasing\Span: New <span> element instance.
strong()
Section titled “strong() ”public static function strong(): UIAwesome\Html\Phrasing\StrongReturns a new Strong instance for the HTML <strong> element.
Returns
UIAwesome\Html\Phrasing\Strong: New <strong> element instance.
table()
Section titled “table() ”public static function table(): UIAwesome\Html\Table\TableReturns a new Table instance for the HTML <table> element.
Returns
UIAwesome\Html\Table\Table: New <table> element instance.
public static function td(): UIAwesome\Html\Table\TdReturns a new Td instance for the HTML <td> element.
Returns
UIAwesome\Html\Table\Td: New <td> element instance.
textarea()
Section titled “textarea() ”public static function textarea(): UIAwesome\Html\Form\TextAreaReturns a new TextArea instance for the HTML <textarea> element.
Returns
UIAwesome\Html\Form\TextArea: New <textarea> element instance.
public static function th(): UIAwesome\Html\Table\ThReturns a new Th instance for the HTML <th> element.
Returns
UIAwesome\Html\Table\Th: New <th> element instance.
public static function tr(): UIAwesome\Html\Table\TrReturns a new Tr instance for the HTML <tr> element.
Returns
UIAwesome\Html\Table\Tr: New <tr> element instance.
public static function ul(): UIAwesome\Html\List\UlReturns a new Ul instance for the HTML <ul> element.
Returns
UIAwesome\Html\List\Ul: New <ul> element instance.