API Documentation for: 1.1.1
Show:

HTML5 Class

Namespace: Canteen\HTML5

Main class of the library

Item Index

Methods

Methods

autoload

() static

Turn on autoloading for the library

html

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

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

useGlobal

()

Use the global html() method