-
Notifications
You must be signed in to change notification settings - Fork 7.6k
xHTML Helper
Category:Helper::Community | Category:Helper::XHTML
The xHTML Helper currently provides 3 functions to assist in developing standards compliant xHTML 1.0 STRICT code.
This function will return a valid doctype statement based on the language and DTD passed to it. If you select a DTD that is not valid for a selected language, this helper will return an xHTML comment stating the error and the STRICT doctype for the selected language. If you select an incorrect language, this helper will return an xHTML comment stating the error and the XHTML1 STRICT doctype.
This helper defaults to XHTML1 STRICT if no parameters are passed to it.
// Output XHTML1 STRICT doctype
xhtml_doctype();
// Output HTML4 FRAMESET doctype
xhtml_doctype('html4', 'frameset');
// Error - there is no XHTML 1.1 STRICT doctype, output comment and XHTML 1.1 DTD
xhtml_doctype('xhtml11', 'strict');
This function will return an xHTML1 STRICT HTML tag with the namespace parameter. This helper defaults to http://www.w3.org/1999/xhtml if no parameters are passed to it.
// Use http://www.w3.org/1999/xhtml Namespace
xhtml_html();
// Use http://xmlns.com/wot/0.1/ Namespace
xhtml_html('http://xmlns.com/wot/0.1/');
This function will return an XHTML1 STRICT META tag for the Content-Type charset encoding. This helper defaults to utf-8 if no parameters are passed to it.
// Use utf-8
xhtml_contentType();
// Use ISO-8859-1
xhtml_contentType('ISO-8859-1');