HTML Builder

The HTML Builder makes it easier to output and manipulate HTML in a view template.

Using the HTML Builder

To create a new HTML Builder you would create an instance of Tomahawk\Html\HtmlBuilder:

HTML Entities

Convert all applicable characters to HTML entities.

Script Tags

Output <script> element to a given source.

You can also pass an array of attributes as the 2nd parameter:

Style Tags

Output <link> element to a given source.

You can also pass an array of attributes as the 2nd parameter:

Links

Output <a> element to a given url.

You can also pass an array of attributes as the 3rd parameter: