API Documentation for: 1.0.1
Show:

html Class

Namespace: global

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'));

Constructor

html

(
  • tag
  • [childrenOrAttributes=null]
  • [attributes=null]
)
Node

Parameters:

  • tag String

    The 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 optional

    If 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 optional

    The attributes list for container tags (e.g., 'class:selected')

Returns:

Node:

Return the html node

Item Index