Class JDocument

Description

Document class, provides an easy interface to parse and display a document

  • since: 11.1

Located in /libraries/joomla/document/document.php (line 19)


	
			
Direct descendents
Class Description
 class JDocumentError DocumentError class, provides an easy interface to parse and display an error page
 class JDocumentFeed DocumentFeed class, provides an easy interface to parse and display any feed document
 class JDocumentHTML DocumentHTML class, provides an easy interface to parse and display a HTML document
 class JDocumentImage DocumentImage class, provides an easy interface to output image data
 class JDocumentJSON JDocumentJSON class, provides an easy interface to parse and display JSON output
 class JDocumentOpensearch OpenSearch class, provides an easy interface to display an OpenSearch document
 class JDocumentRaw DocumentRAW class, provides an easy interface to parse and display raw output
 class JDocumentXml DocumentXML class, provides an easy interface to parse and display XML output
Variable Summary
 static array $instances
 static mixed $_buffer
 string $base
 string $description
 string $direction
 string $language
 string $link
 string $mediaVersion
 string $title
 string $_charset
 object $_engine
 string $_generator
 string $_lineEnd
 string $_mdate
 array $_metaTags
 string $_mime
 string $_namespace
 string $_profile
 array $_script
 array $_scripts
 array $_style
 string $_tab
 string $_type
Method Summary
 static object The getInstance ([string $type = 'html'], [array $attributes = array()])
 JDocument __construct ([array $options = array()])
 JDocument addScript (string $url, [string $type = "text/javascript"], [boolean $defer = false], [boolean $async = false])
 JDocument addScriptDeclaration (string $content, [string $type = 'text/javascript'])
 JDocument addScriptVersion (string $url, [string $version = null], [string $type = "text/javascript"], [boolean $defer = false], [boolean $async = false])
 JDocument addStyleDeclaration (string $content, [string $type = 'text/css'])
 JDocument addStyleSheet (string $url, [string $type = 'text/css'], [string $media = null], [array $attribs = array()])
 JDocument addStyleSheetVersion (string $url, [string $version = null], [string $type = "text/css"], [string $media = null], [array $attribs = array()])
 string getBase ()
 The getBuffer ()
 string getCharset ()
 string getDescription ()
 string getDirection ()
 string getGenerator ()
 string getLanguage ()
 string getLink ()
 string getMediaVersion ()
 string getMetaData (string $name, [boolean $httpEquiv = false])
 string getMimeEncoding ()
 string getModifiedDate ()
 string getTitle ()
 string getType ()
 JDocument parse ([array $params = array()])
 The render ([boolean $cache = false], [array $params = array()])
 JDocument setBase (string $base)
 JDocument setBuffer (string $content, [array $options = array()])
 JDocument setCharset ([string $type = 'utf-8'])
 JDocument setDescription (string $description)
 JDocument setDirection ([string $dir = "ltr"])
 JDocument setGenerator (string $generator)
 JDocument setLanguage ([string $lang = "en-gb"])
 JDocument setLineEnd (string $style)
 JDocument setLink (string $url)
 JDocument setMediaVersion (string $mediaVersion)
 JDocument setMetaData (string $name, string $content, [boolean $http_equiv = false])
 JDocument setMimeEncoding ([string $type = 'text/html'], [boolean $sync = true])
 JDocument setModifiedDate (string $date)
 JDocument setTab (string $string)
 JDocument setTitle (string $title)
 JDocument setType (string $type)
 string _getLineEnd ()
 string _getTab ()
Variables
static array $instances = array() (line 202)

JDocument instances container.

  • since: 11.3
  • access: protected
static mixed $_buffer = null (line 194)

Array of buffered output

  • var: (depends on the renderer)
  • since: 11.1
  • access: public
string $base = '' (line 51)

Document base URL

  • since: 11.1
  • access: public
string $description = '' (line 35)

Document description

  • since: 11.1
  • access: public
string $direction = 'ltr' (line 67)

Contains the document direction setting

  • since: 11.1
  • access: public
string $language = 'en-gb' (line 59)

Contains the document language setting

  • since: 11.1
  • access: public
string $link = '' (line 43)

Document full URL

  • since: 11.1
  • access: public
string $mediaVersion = null (line 210)

Media version added to assets

  • since: 3.2
  • access: protected
string $title = '' (line 27)

Document title

  • since: 11.1
  • access: public
string $_charset = 'utf-8' (line 106)

Contains the character encoding string

  • since: 11.1
  • access: public
object $_engine = null (line 178)

The rendering engine

  • since: 11.1
  • access: public
string $_generator = 'Joomla! - Open Source Content Management' (line 74)

Document generator

  • access: public
string $_lineEnd = "\12" (line 98)

Contains the line end string

  • since: 11.1
  • access: public
string $_mdate = '' (line 82)

Document modified date

  • since: 11.1
  • access: public
array $_metaTags = array() (line 170)

Array of meta tags

  • since: 11.1
  • access: public
string $_mime = '' (line 114)

Document mime type

  • since: 11.1
  • access: public
string $_namespace = '' (line 122)

Document namespace

  • since: 11.1
  • access: public
string $_profile = '' (line 130)

Document profile

  • since: 11.1
  • access: public
array $_script = array() (line 146)

Array of scripts placed in the header

  • since: 11.1
  • access: public
array $_scripts = array() (line 138)

Array of linked scripts

  • since: 11.1
  • access: public
array $_style = array() (line 162)

Array of included style declarations

  • since: 11.1
  • access: public
array $_styleSheets = array() (line 154)

Array of linked style sheets

  • since: 11.1
  • access: public
string $_tab = "\11" (line 90)

Tab string

  • since: 11.1
  • access: public
string $_type = null (line 186)

The document type

  • since: 11.1
  • access: public
Methods
static getInstance (line 274)

Returns the global JDocument object, only creating it if it doesn't already exist.

  • return: document object.
  • throws: RuntimeException
  • since: 11.1
  • access: public
static object The getInstance ([string $type = 'html'], [array $attributes = array()])
  • string $type: The document type to instantiate
  • array $attributes: Array of attributes
Constructor __construct (line 219)

Class constructor.

  • since: 11.1
  • access: public
JDocument __construct ([array $options = array()])
  • array $options: Associative array of options

Redefined in descendants as:
addScript (line 466)

Adds a linked script to the page

  • return: instance of $this to allow chaining
  • since: 11.1
  • access: public
JDocument addScript (string $url, [string $type = "text/javascript"], [boolean $defer = false], [boolean $async = false])
  • string $url: URL to the linked script
  • string $type: Type of script. Defaults to 'text/javascript'
  • boolean $defer: Adds the defer attribute.
  • boolean $async: Adds the async attribute.
addScriptDeclaration (line 515)

Adds a script to the page

  • return: instance of $this to allow chaining
  • since: 11.1
  • access: public
JDocument addScriptDeclaration (string $content, [string $type = 'text/javascript'])
  • string $content: Script
  • string $type: Scripting mime (defaults to 'text/javascript')
addScriptVersion (line 489)

Adds a linked script to the page with a version to allow to flush it. Ex: myscript.js54771616b5bceae9df03c6173babf11d If not specified Joomla! automatically handles versioning

  • return: instance of $this to allow chaining
  • since: 3.2
  • access: public
JDocument addScriptVersion (string $url, [string $version = null], [string $type = "text/javascript"], [boolean $defer = false], [boolean $async = false])
  • string $url: URL to the linked script
  • string $version: Version of the script
  • string $type: Type of script. Defaults to 'text/javascript'
  • boolean $defer: Adds the defer attribute.
  • boolean $async: [description]
addStyleDeclaration (line 590)

Adds a stylesheet declaration to the page

  • return: instance of $this to allow chaining
  • since: 11.1
  • access: public
JDocument addStyleDeclaration (string $content, [string $type = 'text/css'])
  • string $content: Style declarations
  • string $type: Type of stylesheet (defaults to 'text/css')
addStyleSheet (line 541)

Adds a linked stylesheet to the page

  • return: instance of $this to allow chaining
  • since: 11.1
  • access: public
JDocument addStyleSheet (string $url, [string $type = 'text/css'], [string $media = null], [array $attribs = array()])
  • string $url: URL to the linked style sheet
  • string $type: Mime encoding type
  • string $media: Media type that this stylesheet applies to
  • array $attribs: Array of attributes
addStyleSheetVersion (line 564)

Adds a linked stylesheet version to the page. Ex: template.css?54771616b5bceae9df03c6173babf11d If not specified Joomla! automatically handles versioning

  • return: instance of $this to allow chaining
  • since: 3.2
  • access: public
JDocument addStyleSheetVersion (string $url, [string $version = null], [string $type = "text/css"], [string $media = null], [array $attribs = array()])
  • string $url: URL to the linked style sheet
  • string $version: Version of the stylesheet
  • string $type: Mime encoding type
  • string $media: Media type that this stylesheet applies to
  • array $attribs: Array of attributes
getBase (line 767)

Return the base URI of the document.

  • since: 11.1
  • access: public
string getBase ()
getBuffer (line 357)

Get the contents of the document buffer

  • return: contents of the document buffer
  • since: 11.1
  • access: public
The getBuffer ()

Redefined in descendants as:
getCharset (line 627)

Returns the document charset encoding.

  • since: 11.1
  • access: public
string getCharset ()
getDescription (line 795)

Return the title of the page.

  • since: 11.1
  • access: public
string getDescription ()
getDirection (line 683)

Returns the document direction declaration.

  • since: 11.1
  • access: public
string getDirection ()
getGenerator (line 851)

Returns the document generator

  • since: 11.1
  • access: public
string getGenerator ()
getLanguage (line 655)

Returns the document language.

  • since: 11.1
  • access: public
string getLanguage ()
getLink (line 823)

Returns the document base url

  • since: 11.1
  • access: public
string getLink ()
getMediaVersion (line 739)

Return the media version

  • since: 3.2
  • access: public
string getMediaVersion ()
getMetaData (line 389)

Gets a meta tag.

  • since: 11.1
  • access: public
string getMetaData (string $name, [boolean $httpEquiv = false])
  • string $name: Value of name or http-equiv tag
  • boolean $httpEquiv: META type "http-equiv" defaults to null
getMimeEncoding (line 922)

Return the document MIME encoding that is sent to the browser.

  • since: 11.1
  • access: public
string getMimeEncoding ()
getModifiedDate (line 879)

Returns the document modified date

  • since: 11.1
  • access: public
string getModifiedDate ()
getTitle (line 711)

Return the title of the document.

  • since: 11.1
  • access: public
string getTitle ()
getType (line 345)

Returns the document type

  • since: 11.1
  • access: public
string getType ()
loadRenderer (line 1006)

Load a renderer

  • return: Object or null if class does not exist
  • since: 11.1
  • throws: RuntimeException
  • access: public
JDocumentRenderer loadRenderer (string $type)
  • string $type: The renderer type
parse (line 1043)

Parses the document and prepares the buffers

  • return: instance of $this to allow chaining
  • since: 11.1
  • access: public
JDocument parse ([array $params = array()])
  • array $params: The array of parameters

Redefined in descendants as:
render (line 1058)

Outputs the document

  • return: rendered data
  • since: 11.1
  • access: public
The render ([boolean $cache = false], [array $params = array()])
  • boolean $cache: If true, cache the output
  • array $params: Associative array of attributes

Redefined in descendants as:
setBase (line 753)

Sets the base URI of the document

  • return: instance of $this to allow chaining
  • since: 11.1
  • access: public
JDocument setBase (string $base)
  • string $base: The base URI to be set
setBuffer (line 372)

Set the contents of the document buffer

  • return: instance of $this to allow chaining
  • since: 11.1
  • access: public
JDocument setBuffer (string $content, [array $options = array()])
  • string $content: The content to be set in the buffer.
  • array $options: Array of optional elements.

Redefined in descendants as:
setCharset (line 613)

Sets the document charset

  • return: instance of $this to allow chaining
  • since: 11.1
  • access: public
JDocument setCharset ([string $type = 'utf-8'])
  • string $type: Charset encoding string
setDescription (line 781)

Sets the description of the document

  • return: instance of $this to allow chaining
  • since: 11.1
  • access: public
JDocument setDescription (string $description)
  • string $description: The description to set
setDirection (line 669)

Sets the global document direction declaration. Default is left-to-right (ltr).

  • return: instance of $this to allow chaining
  • since: 11.1
  • access: public
JDocument setDirection ([string $dir = "ltr"])
  • string $dir: The language direction to be set
setGenerator (line 837)

Sets the document generator

  • return: instance of $this to allow chaining
  • since: 11.1
  • access: public
JDocument setGenerator (string $generator)
  • string $generator: The generator to be set
setLanguage (line 641)

Sets the global document language declaration. Default is English (en-gb).

  • return: instance of $this to allow chaining
  • since: 11.1
  • access: public
JDocument setLanguage ([string $lang = "en-gb"])
  • string $lang: The language to be set
setLineEnd (line 936)

Sets the line end style to Windows, Mac, Unix or a custom string.

  • return: instance of $this to allow chaining
  • since: 11.1
  • access: public
JDocument setLineEnd (string $style)
  • string $style: "win", "mac", "unix" or custom string.
setLink (line 809)

Sets the document link

  • return: instance of $this to allow chaining
  • since: 11.1
  • access: public
JDocument setLink (string $url)
  • string $url: A url
setMediaVersion (line 725)

Set the assets version

  • return: instance of $this to allow chaining
  • since: 3.2
  • access: public
JDocument setMediaVersion (string $mediaVersion)
  • string $mediaVersion: Media version to use
setMetaData (line 427)

Sets or alters a meta tag.

  • return: instance of $this to allow chaining
  • since: 11.1
  • access: public
JDocument setMetaData (string $name, string $content, [boolean $http_equiv = false])
  • string $name: Value of name or http-equiv tag
  • string $content: Value of the content tag
  • boolean $http_equiv: META type "http-equiv" defaults to null
setMimeEncoding (line 902)

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 (http://www.w3.org/TR/xhtml-media-types/) for more details.

JDocument setMimeEncoding ([string $type = 'text/html'], [boolean $sync = true])
  • string $type: The document type to be sent
  • boolean $sync: Should the type be synced with HTML?
setModifiedDate (line 865)

Sets the document modified date

  • return: instance of $this to allow chaining
  • since: 11.1
  • access: public
JDocument setModifiedDate (string $date)
  • string $date: The date to be set
setTab (line 977)

Sets the string used to indent HTML

  • return: instance of $this to allow chaining
  • since: 11.1
  • access: public
JDocument setTab (string $string)
  • string $string: String used to indent ("\11", "\t", ' ', etc.).
setTitle (line 697)

Sets the title of the document

  • return: instance of $this to allow chaining
  • since: 11.1
  • access: public
JDocument setTitle (string $title)
  • string $title: The title to be set
setType (line 331)

Set the document type

  • return: instance of $this to allow chaining
  • since: 11.1
  • access: public
JDocument setType (string $type)
  • string $type: Type document is to set to
_getLineEnd (line 963)

Returns the lineEnd

  • since: 11.1
  • access: public
string _getLineEnd ()
_getTab (line 991)

Returns a string containing the unit for indenting HTML

  • since: 11.1
  • access: public
string _getTab ()

Documentation generated on Tue, 19 Nov 2013 15:01:37 +0100 by phpDocumentor 1.4.3