Joomla! Platform 12.1

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

Class JObject   (Subpackage Object)

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

Document base URL

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

Document description

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

Contains the document direction setting

  • since: 11.1
  • access: public
array $instances = array() (line 202)
  • var: JDocument instances container.
  • since: 11.3
  • access: protected
string $language = 'en-gb' (line 61)

Contains the document language setting

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

Document full URL

  • since: 11.1
  • access: public
string $title = '' (line 29)

Document title

  • since: 11.1
  • access: public
mixed $_buffer = null (line 196)

Array of buffered output

  • var: (depends on the renderer)
  • since: 11.1
  • access: public
string $_charset = 'utf-8' (line 108)

Contains the character encoding string

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

The rendering engine

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

Document generator

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

Contains the line end string

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

Document modified date

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

Array of meta tags

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

Document mime type

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

Document namespace

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

Document profile

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

Array of scripts placed in the header

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

Array of linked scripts

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

Array of included style declarations

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

Array of linked style sheets

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

Tab string

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

The document type

  • since: 11.1
  • access: public

Inherited Variables

Inherited from JObject

Variable JObject::$_errors
Methods
Constructor __construct (line 211)

Class constructor.

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

Redefinition of:
JObject::__construct()
Class constructor, overridden in descendant classes.

Redefined in descendants as:
addScript (line 453)

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

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')
addStyleDeclaration (line 517)

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

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
getBase (line 666)

Return the base URI of the document.

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

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

Returns the document charset encoding.

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

Return the title of the page.

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

Returns the document direction declaration.

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

Returns the document generator

  • since: 11.1
  • access: public
string getGenerator ()
getInstance (line 263)

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

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

Returns the document language.

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

Returns the document base url

  • since: 11.1
  • access: public
string getLink ()
getMetaData (line 376)

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

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

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

Returns the document modified date

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

Return the title of the document.

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

Returns the document type

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

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

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

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

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

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

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

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

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

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

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

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

Sets the document link

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

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

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

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

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

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

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

Returns the lineEnd

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

Returns a string containing the unit for indenting HTML

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

Inherited Methods

Inherited From JObject

 JObject::__construct()
 JObject::def()
 JObject::get()
 JObject::getError()
 JObject::getErrors()
 JObject::getProperties()
 JObject::set()
 JObject::setError()
 JObject::setProperties()
 JObject::__toString()
/html>