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

JObject
   |
   --JDocument
Direct descendents
Class Description
JDocumentRaw DocumentRAW class, provides an easy interface to parse and display raw output
JDocumentJSON JDocumentJSON class, provides an easy interface to parse and display JSON output
JDocumentError DocumentError class, provides an easy interface to parse and display an error page
JDocumentXml DocumentXML class, provides an easy interface to parse and display XML output
JDocumentFeed DocumentFeed class, provides an easy interface to parse and display any feed document
JDocumentHTML DocumentHTML class, provides an easy interface to parse and display a HTML document
JDocumentOpensearch OpenSearch class, provides an easy interface to display an OpenSearch document
Variable Summary
static array $instances
static mixed $_buffer
string $base
string $description
string $direction
string $language
string $link
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 addStyleDeclaration (string $content, [string $type = 'text/css'])
JDocument addStyleSheet (string $url, [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 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 setMetaData (string $name, string $content, [boolean $http_equiv = false], [boolean $sync = true])
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 204)
  • var: JDocument instances container.
  • since: 11.3
  • access: protected
static mixed $_buffer = null (line 198)

Array of buffered output

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

Document base URL

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

Document description

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

Contains the document direction setting

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

Contains the document language setting

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

Document full URL

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

Document title

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

Contains the character encoding string

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

The rendering engine

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

Document generator

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

Contains the line end string

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

Document modified date

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

Array of meta tags

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

Document mime type

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

Document namespace

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

Document profile

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

Array of scripts placed in the header

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

Array of linked scripts

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

Array of included style declarations

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

Array of linked style sheets

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

Tab string

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

The document type

  • since: 11.1
  • access: public

Inherited Variables

Inherited from JObject

JObject::$_errors
Methods
static method getInstance (line 264)

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

  • return: document object.
  • 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 213)

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

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

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

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

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

Return the base URI of the document.

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

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

Returns the document charset encoding.

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

Return the title of the page.

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

Returns the document direction declaration.

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

Returns the document generator

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

Returns the document language.

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

Returns the document base url

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

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

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

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

Returns the document modified date

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

Return the title of the document.

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

Returns the document type

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

Load a renderer

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

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

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

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

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

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

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

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

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

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

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

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

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], [boolean $sync = true])
  • 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
  • boolean $sync: Should http-equiv="content-type" by synced with HTTP-header?
setMimeEncoding (line 809)

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

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

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

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

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

Returns the lineEnd

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

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()
JObject::__toString()

Documentation generated on Mon, 25 Jun 2012 13:54:18 -0500 by phpDocumentor 1.4.4