Документация по Joomla 1.7

Joomla.Platform\JDocument
libraries/joomla/document/document.php at line 23

Class JDocument

JObject
└─JDocument
All Known Subclasses:
JDocumentError JDocumentFeed JDocumentHTML JDocumentJSON JDocumentOpensearch JDocumentRaw JDocumentXml

public class JDocument
extends JObject

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

Subpackage:
Document
Since:
11.1

Field Summary
static mixed (depends on the renderer)

$_buffer

Array of buffered output

string

$_charset

Contains the character encoding string

object

$_engine

The rendering engine

string

$_generator

Document generator

string

$_lineEnd

Contains the line end string

string

$_mdate

Document modified date

array

$_metaTags

Array of meta tags

string

$_mime

Document mime type

string

$_namespace

Document namespace

string

$_profile

Document profile

array

$_script

Array of scripts placed in the header

array

$_scripts

Array of linked scripts

array

$_style

Array of included style declarations

array

$_styleSheets

Array of linked style sheets

string

$_tab

Tab string

string

$_type

The document type

string

$base

Document base URL

string

$description

Document description

string

$direction

Contains the document direction setting

string

$language

Contains the document language setting

string

$link

Document full URL

string

$title

Document title

Fields inherited from Joomla.Platform\JObject
_errors
Constructor Summary
JDocument

__construct(array options, mixed properties)

Class constructor.

Method Summary
static object

getInstance(string type, array attribues, mixed attributes)

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

static

setType(string type)

Set the document type

string

getType()

Returns the document type

The

getBuffer()

Get the contents of the document buffer

void

setBuffer(string content, array options)

Set the contents of the document buffer

string

getMetaData(string name, bool http_equiv)

Gets a meta tag.

void

setMetaData(string name, string content, bool http_equiv, bool sync)

Sets or alters a meta tag.

addScript(string url, string type, bool defer, bool async)

Adds a linked script to the page

void

addScriptDeclaration(string content, string type)

Adds a script to the page

void

addStyleSheet(string url, string type, string media, array attribs)

Adds a linked stylesheet to the page

void

addStyleDeclaration(string content, string type)

Adds a stylesheet declaration to the page

void

setCharset(string type)

Sets the document charset

string

getCharset()

Returns the document charset encoding.

void

setLanguage(string lang)

Sets the global document language declaration.

string

getLanguage()

Returns the document language.

void

setDirection(string lang, str dir)

Sets the global document direction declaration.

string

getDirection()

Returns the document direction declaration.

void

setTitle(string title)

Sets the title of the document

string

getTitle()

Return the title of the document.

void

setBase(string base)

Sets the base URI of the document

string

getBase()

Return the base URI of the document.

void

setDescription(string title, mixed description)

Sets the description of the document

string

getDescription()

Return the title of the page.

void

setLink(string url)

Sets the document link

string

getLink()

Returns the document base url

void

setGenerator(string generator)

Sets the document generator

string

getGenerator()

Returns the document generator

void

setModifiedDate(string date)

Sets the document modified date

string

getModifiedDate()

Returns the document modified date

void

setMimeEncoding(string type, bool sync)

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

string

getMimeEncoding()

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

void

setLineEnd(string style)

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

string

_getLineEnd()

Returns the lineEnd

void

setTab(string string)

Sets the string used to indent HTML

string

_getTab()

Returns a string containing the unit for indenting HTML

mixed

loadRenderer(string type)

Load a renderer

null

parse(mixed params)

Parses the document and prepares the buffers

The

render(boolean cache, boolean compress, array params)

Outputs the document

Methods inherited from Joomla.Platform\JObject
__construct, __toString, def, get, getError, getErrors, getProperties, set, setError, setProperties, toString

Field Detail

libraries/joomla/document/document.php at line 185

_buffer

public static mixed (depends on the renderer) $_buffer = null

Array of buffered output


libraries/joomla/document/document.php at line 107

_charset

public string $_charset = 'utf-8'

Contains the character encoding string


libraries/joomla/document/document.php at line 170

_engine

public object $_engine = null

The rendering engine


libraries/joomla/document/document.php at line 78

_generator

public string $_generator = 'Joomla! 1.7 - Open Source Content Management'

Document generator


libraries/joomla/document/document.php at line 100

_lineEnd

public string $_lineEnd = "\12"

Contains the line end string


libraries/joomla/document/document.php at line 86

_mdate

public string $_mdate = ''

Document modified date

Since:
11.1

libraries/joomla/document/document.php at line 163

_metaTags

public array $_metaTags = array()

Array of meta tags


libraries/joomla/document/document.php at line 114

_mime

public string $_mime = ''

Document mime type


libraries/joomla/document/document.php at line 121

_namespace

public string $_namespace = ''

Document namespace


libraries/joomla/document/document.php at line 128

_profile

public string $_profile = ''

Document profile


libraries/joomla/document/document.php at line 142

_script

public array $_script = array()

Array of scripts placed in the header


libraries/joomla/document/document.php at line 135

_scripts

public array $_scripts = array()

Array of linked scripts


libraries/joomla/document/document.php at line 156

_style

public array $_style = array()

Array of included style declarations


libraries/joomla/document/document.php at line 149

_styleSheets

public array $_styleSheets = array()

Array of linked style sheets


libraries/joomla/document/document.php at line 93

_tab

public string $_tab = "\11"

Tab string


libraries/joomla/document/document.php at line 178

_type

public string $_type = null

The document type

Since:
11.1

libraries/joomla/document/document.php at line 55

base

public string $base = ''

Document base URL

Since:
11.1

libraries/joomla/document/document.php at line 39

description

public string $description = ''

Document description

Since:
11.1

libraries/joomla/document/document.php at line 71

direction

public string $direction = 'ltr'

Contains the document direction setting

Since:
11.1

libraries/joomla/document/document.php at line 63

language

public string $language = 'en-gb'

Contains the document language setting

Since:
11.1

libraries/joomla/document/document.php at line 47 public string $link = ''

Document full URL

Since:
11.1

libraries/joomla/document/document.php at line 31

title

public string $title = ''

Document title

Since:
11.1

Constructor Detail

libraries/joomla/document/document.php at line 196

__construct

public JDocument __construct(array options, mixed properties)

Class constructor.

Parameters:
options - Associative array of options
Since:
11.1

Method Detail

libraries/joomla/document/document.php at line 239

getInstance

public static object getInstance(string type, array attribues, mixed attributes)

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

Parameters:
type - The document type to instantiate
attribues - Array of attributes
Returns:
The document object.
Since:
11.1

libraries/joomla/document/document.php at line 293

setType

public static setType(string type)

Set the document type

Since:
11.1

libraries/joomla/document/document.php at line 304

getType

public string getType()

Returns the document type

Since:
11.1

libraries/joomla/document/document.php at line 315

getBuffer

public The getBuffer()

Get the contents of the document buffer

Returns:
contents of the document buffer
Since:
11.1

libraries/joomla/document/document.php at line 329

setBuffer

public void setBuffer(string content, array options)

Set the contents of the document buffer

Parameters:
content - The content to be set in the buffer.
options - Array of optional elements.
Since:
11.1

libraries/joomla/document/document.php at line 343

getMetaData

public string getMetaData(string name, bool http_equiv)

Gets a meta tag.

Parameters:
name - Value of name or http-equiv tag
http_equiv - META type "http-equiv" defaults to null
Since:
11.1

libraries/joomla/document/document.php at line 376

setMetaData

public void setMetaData(string name, string content, bool http_equiv, bool sync)

Sets or alters a meta tag.

Parameters:
name - Value of name or http-equiv tag
content - Value of the content tag
http_equiv - META type "http-equiv" defaults to null
sync - Should http-equiv="content-type" by synced with HTTP-header?
Since:
11.1

libraries/joomla/document/document.php at line 411

addScript

public addScript(string url, string type, bool defer, bool async)

Adds a linked script to the page

Parameters:
url - URL to the linked script
type - Type of script. Defaults to 'text/javascript'
defer - Adds the defer attribute.
async - Adds the async attribute.
Since:
11.1

libraries/joomla/document/document.php at line 427

addScriptDeclaration

public void addScriptDeclaration(string content, string type)

Adds a script to the page

Parameters:
content - Script
type - Scripting mime (defaults to 'text/javascript')
Since:
11.1

libraries/joomla/document/document.php at line 448

addStyleSheet

public void addStyleSheet(string url, string type, string media, array attribs)

Adds a linked stylesheet to the page

Parameters:
url - URL to the linked style sheet
type - Mime encoding type
media - Media type that this stylesheet applies to
attribs - Array of attributes
Since:
11.1

libraries/joomla/document/document.php at line 463

addStyleDeclaration

public void addStyleDeclaration(string content, string type)

Adds a stylesheet declaration to the page

Parameters:
content - Style declarations
type - Type of stylesheet (defaults to 'text/css')

libraries/joomla/document/document.php at line 480

setCharset

public void setCharset(string type)

Sets the document charset

Parameters:
type - Charset encoding string

libraries/joomla/document/document.php at line 490

getCharset

public string getCharset()

Returns the document charset encoding.


libraries/joomla/document/document.php at line 502

setLanguage

public void setLanguage(string lang)

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


libraries/joomla/document/document.php at line 512

getLanguage

public string getLanguage()

Returns the document language.


libraries/joomla/document/document.php at line 524

setDirection

public void setDirection(string lang, str dir)

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


libraries/joomla/document/document.php at line 535

getDirection

public string getDirection()

Returns the document direction declaration.


libraries/joomla/document/document.php at line 547

setTitle

public void setTitle(string title)

Sets the title of the document


libraries/joomla/document/document.php at line 557

getTitle

public string getTitle()

Return the title of the document.


libraries/joomla/document/document.php at line 569

setBase

public void setBase(string base)

Sets the base URI of the document


libraries/joomla/document/document.php at line 580

getBase

public string getBase()

Return the base URI of the document.


libraries/joomla/document/document.php at line 592

setDescription

public void setDescription(string title, mixed description)

Sets the description of the document


libraries/joomla/document/document.php at line 603

getDescription

public string getDescription()

Return the title of the page.


libraries/joomla/document/document.php at line 615

setLink

public void setLink(string url)

Sets the document link

Parameters:
url - A url

libraries/joomla/document/document.php at line 625

getLink

public string getLink()

Returns the document base url


libraries/joomla/document/document.php at line 637

setGenerator

public void setGenerator(string generator)

Sets the document generator


libraries/joomla/document/document.php at line 647

getGenerator

public string getGenerator()

Returns the document generator


libraries/joomla/document/document.php at line 659

setModifiedDate

public void setModifiedDate(string date)

Sets the document modified date


libraries/joomla/document/document.php at line 669

getModifiedDate

public string getModifiedDate()

Returns the document modified date


libraries/joomla/document/document.php at line 688

setMimeEncoding

public void setMimeEncoding(string type, bool sync)

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.

Parameters:
sync - Should the type be synced with HTML?

libraries/joomla/document/document.php at line 703

getMimeEncoding

public string getMimeEncoding()

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


libraries/joomla/document/document.php at line 715

setLineEnd

public void setLineEnd(string style)

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

Parameters:
style - "win", "mac", "unix" or custom string.

libraries/joomla/document/document.php at line 738

_getLineEnd

public string _getLineEnd()

Returns the lineEnd


libraries/joomla/document/document.php at line 750

setTab

public void setTab(string string)

Sets the string used to indent HTML

Parameters:
string - String used to indent ("\11", "\t", ' ', etc.).

libraries/joomla/document/document.php at line 760

_getTab

public string _getTab()

Returns a string containing the unit for indenting HTML


libraries/joomla/document/document.php at line 773

loadRenderer

public mixed loadRenderer(string type)

Load a renderer

Parameters:
type - The renderer type
Returns:
Object or null if class does not exist
Since:
11.1

libraries/joomla/document/document.php at line 802

parse

public null parse(mixed params)

Parses the document and prepares the buffers


libraries/joomla/document/document.php at line 816

render

public The render(boolean cache, boolean compress, array params)

Outputs the document

Parameters:
cache - If true, cache the output
compress - If true, compress the output
params - Associative array of attributes
Returns:
rendered data

Документация по Joomla 1.7