Document
class Document
Document class, provides an easy interface to parse and display a document
Properties
string | $title | Document title | |
string | $description | Document description | |
string | $link | Document full URL | |
string | $base | Document base URL | |
string | $language | Contains the document language setting | |
string | $direction | Contains the document direction setting | |
string | $_generator | Document generator | |
string|Date | $_mdate | Document modified date | |
string | $_tab | Tab string | |
string | $_lineEnd | Contains the line end string | |
string | $_charset | Contains the character encoding string | |
string | $_mime | Document mime type | |
string | $_namespace | Document namespace | |
string | $_profile | Document profile | |
array | $_scripts | Array of linked scripts | |
array | $_script | Array of scripts placed in the header | |
array | $_styleSheets | Array of linked style sheets | |
array | $_style | Array of included style declarations | |
array | $_metaTags | Array of meta tags | |
object | $_engine | The rendering engine | |
string | $_type | The document type | |
static mixed | $_buffer | Array of buffered output |
Methods
Class constructor.
Returns the global Document object, only creating it if it doesn't already exist.
Returns the document type
Get the contents of the document buffer
Set the contents of the document buffer
Gets a meta tag.
Sets or alters a meta tag.
Adds a linked script to the page
Adds a linked script to the page with a version to allow to flush it. Ex: myscript.js?54771616b5bceae9df03c6173babf11d If not specified Joomla! automatically handles versioning
Adds a script to the page
Add option for script
Get script(s) options
Adds a linked stylesheet to the page
Adds a linked stylesheet version to the page. Ex: template.css?54771616b5bceae9df03c6173babf11d If not specified Joomla! automatically handles versioning
Adds a stylesheet declaration to the page
Sets the document charset
Returns the document charset encoding.
Sets the global document language declaration. Default is English (en-gb).
Returns the document language.
Sets the global document direction declaration. Default is left-to-right (ltr).
Returns the document direction declaration.
Return the title of the document.
Set the assets version
Return the media version
Return the base URI of the document.
Sets the description of the document
Return the description of the document.
Returns the document base url
Sets the document generator
Returns the document generator
Returns the document modified date
Sets the document MIME encoding that is sent to the browser.
Return the document MIME encoding that is sent to the browser.
Sets the line end style to Windows, Mac, Unix or a custom string.
Returns the lineEnd
Returns a string containing the unit for indenting HTML
Load a renderer
Outputs the document
Details
static
object
getInstance(
string $type = 'html',
array $attributes = array())
Returns the global Document object, only creating it if it doesn't already exist.
Document
setBuffer(
string $content,
array $options = array())
Set the contents of the document buffer
Document
setMetaData(
string $name,
mixed $content,
string $attribute = 'name')
Sets or alters a meta tag.
Document
addScript(
string $url,
array $options = array(),
array $attribs = array())
Adds a linked script to the page
Document
addScriptVersion(
string $url,
array $options = array(),
array $attribs = array())
Adds a linked script to the page with a version to allow to flush it. Ex: myscript.js?54771616b5bceae9df03c6173babf11d If not specified Joomla! automatically handles versioning
Document
addScriptDeclaration(
string $content,
string $type = 'text/javascript')
Adds a script to the page
Document
addStyleSheet(
string $url,
array $options = array(),
array $attribs = array())
Adds a linked stylesheet to the page
Document
addStyleSheetVersion(
string $url,
array $options = array(),
array $attribs = array())
Adds a linked stylesheet version to the page. Ex: template.css?54771616b5bceae9df03c6173babf11d If not specified Joomla! automatically handles versioning
Document
addStyleDeclaration(
string $content,
string $type = 'text/css')
Adds a stylesheet declaration to the page
Document
setLanguage(
string $lang = 'en-gb')
Sets the global document language declaration. Default is English (en-gb).
Document
setDirection(
string $dir = 'ltr')
Sets the global document direction declaration. Default is left-to-right (ltr).
Document
setMimeEncoding(
string $type = 'text/html',
boolean $sync = true)
Sets the document MIME encoding that is sent to the browser.
This usually will be text/html because most browsers cannot yet accept the proper mime settings for XHTML: application/xhtml+xml and to a lesser extent application/xml and text/xml. See the W3C note ({@link http://www.w3.org/TR/xhtml-media-types/ http://www.w3.org/TR/xhtml-media-types/}) for more details.
Document
setLineEnd(
string $style)
Sets the line end style to Windows, Mac, Unix or a custom string.