HTML5 Class
Main class of the library
Methods
autoload
()
static
Turn on autoloading for the library
html
-
tag
-
[childrenOrAttributes=null]
-
[attributes=null]
This is the global function is the main entry for interacting with the HTML5 for PHP library.
using html()
global function you can create HTML5 quickly and easily. For more
examples and instruction on how to use this library, please refer to the the
GitHub project.
To install the library simply include html.php
, this takes care of any autoloading that's needed
for the rest of the library.
echo html('img src=home.jpg');
echo html('img', 'src=home.jpg');
echo html('a', array('href'=>'about.html'));
Parameters:
-
tag
StringThe name of the tag as a string for example 'tr', 'table', can be followed by CSS selector, e.g. 'a#backButton' or 'a.button'
-
[childrenOrAttributes=null]
Dictionary | Node | String | Array optionalIf the tag is a NodeContainer, this can be an array of attributes, another html node or some text. If the tag is a single node, this can be an array or chain of attributes
-
[attributes=null]
Dictionary | String optionalThe attributes list for container tags (e.g., 'class:selected')
Returns:
Return the html node
useGlobal
()
Use the global html()
method