class JDocumentJSON extends JDocument


Located at : UKNOWVA_ROOT/libraries/joomla/document/json/json.php

Properties

string $title Document title from JDocument
string $description Document description from JDocument
$link Document full URL from JDocument
string $base Document base URL from JDocument
string $language Contains the document language setting from JDocument
string $direction Contains the document direction setting from JDocument
string $_generator Document generator from JDocument
string $_mdate Document modified date from JDocument
string $_tab Tab string from JDocument
string $_lineEnd Contains the line end string from JDocument
string $_charset Contains the character encoding string from JDocument
string $_mime Document mime type from JDocument
string $_namespace Document namespace from JDocument
string $_profile Document profile from JDocument
array $_scripts Array of linked scripts from JDocument
array $_script Array of scripts placed in the header from JDocument
array $_styleSheets Array of linked style sheets from JDocument
array $_style Array of included style declarations from JDocument
array $_metaTags Array of meta tags from JDocument
object $_engine The rendering engine from JDocument
string $_type The document type from JDocument
static mixed $_buffer Array of buffered output from JDocument

Methods

__construct(array $options = array())

Class constructor

string
__toString()

Magic method to convert the object to a string gracefully.

from JObject
mixed
def(string $property, mixed $default = null)

Sets a default value if not alreay assigned

from JObject
mixed
get(string $property, mixed $default = null)

Returns a property of the object or the default value if the property is not set.

from JObject
array
getProperties(boolean $public = true)

Returns an associative array of object properties.

from JObject
string
getError(integer $i = null, boolean $toString = true)

Get the most recent error message.

from JObject
array
getErrors()

Return all errors, if any.

from JObject
mixed
set(string $property, mixed $value = null)

Modifies a property of the object, creating it if it does not already exist.

from JObject
boolean
setProperties(mixed $properties)

Set the object properties based on a named array/hash.

from JObject
void
setError(string $error)

Add an error message.

from JObject
string
toString() deprecated

No description

from JObject
static object
getInstance($type = 'html', $attributes = array())

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

from JDocument
setType(string $type)

Set the document type

from JDocument
string
getType()

Returns the document type

from JDocument
The
getBuffer()

Get the contents of the document buffer

from JDocument
void
setBuffer(string $content, array $options = array())

Set the contents of the document buffer

from JDocument
string
getMetaData(string $name, bool $http_equiv = false)

Gets a meta tag.

from JDocument
void
setMetaData(string $name, string $content, bool $http_equiv = false, bool $sync = true)

Sets or alters a meta tag.

from JDocument
addScript(string $url, string $type = 'text/javascript', bool $defer = false, bool $async = false)

Adds a linked script to the page

from JDocument
void
addScriptDeclaration(string $content, string $type = 'text/javascript')

Adds a script to the page

from JDocument
void
addStyleSheet(string $url, string $type = 'text/css', string $media = null, array $attribs = array())

Adds a linked stylesheet to the page

from JDocument
void
addStyleDeclaration(string $content, string $type = 'text/css')

Adds a stylesheet declaration to the page

from JDocument
void
setCharset(string $type = 'utf-8')

Sets the document charset

from JDocument
string
getCharset()

Returns the document charset encoding.

from JDocument
void
setLanguage(string $lang = 'en-gb')

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

from JDocument
string
getLanguage()

Returns the document language.

from JDocument
void
setDirection($dir = 'ltr')

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

from JDocument
string
getDirection()

Returns the document direction declaration.

from JDocument
void
setTitle(string $title)

Sets the title of the document

from JDocument
string
getTitle()

Return the title of the document.

from JDocument
void
setBase(string $base)

Sets the base URI of the document

from JDocument
string
getBase()

Return the base URI of the document.

from JDocument
void
setDescription($description)

Sets the description of the document

from JDocument
string
getDescription()

Return the title of the page.

from JDocument
void
setLink(string $url)

Sets the document link

from JDocument
string
getLink()

Returns the document base url

from JDocument
void
setGenerator(string $generator)

Sets the document generator

from JDocument
string
getGenerator()

Returns the document generator

from JDocument
void
setModifiedDate(string $date)

Sets the document modified date

from JDocument
string
getModifiedDate()

Returns the document modified date

from JDocument
void
setMimeEncoding(string $type = 'text/html', bool $sync = true)

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

from JDocument
string
getMimeEncoding()

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

from JDocument
void
setLineEnd(string $style)

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

from JDocument
string
_getLineEnd()

Returns the lineEnd

from JDocument
void
setTab(string $string)

Sets the string used to indent HTML

from JDocument
string
_getTab()

Returns a string containing the unit for indenting HTML

from JDocument
mixed
loadRenderer(string $type)

Load a renderer

from JDocument
null
parse($params = array())

Parses the document and prepares the buffers

from JDocument
The
render($cache = false, $params = array())

Render the document.

string
getName()

Returns the document name

void
setName(string $name = 'joomla')

Sets the document name

Details

at line 42
JObject __construct(array $options = array())

Class constructor

Parameters

array $options Associative array of options

Return Value

JObject

in JObject at line 56
string __toString()

Magic method to convert the object to a string gracefully.

Return Value

string The classname.

in JObject at line 70
mixed def(string $property, mixed $default = null)

Sets a default value if not alreay assigned

Parameters

string $property The name of the property.
mixed $default The default value.

Return Value

mixed

in JObject at line 88
mixed get(string $property, mixed $default = null)

Returns a property of the object or the default value if the property is not set.

Parameters

string $property The name of the property.
mixed $default The default value.

Return Value

mixed The value of the property.

See also

getProperties()

in JObject at line 107
array getProperties(boolean $public = true)

Returns an associative array of object properties.

Parameters

boolean $public If true, returns only the public properties.

Return Value

array

See also

get()

in JObject at line 133
string getError(integer $i = null, boolean $toString = true)

Get the most recent error message.

Parameters

integer $i Option error index.
boolean $toString Indicates if JError objects should return their error message.

Return Value

string Error message

in JObject at line 165
array getErrors()

Return all errors, if any.

Return Value

array Array of error messages or JErrors.

in JObject at line 180
mixed set(string $property, mixed $value = null)

Modifies a property of the object, creating it if it does not already exist.

Parameters

string $property The name of the property.
mixed $value The value of the property to set.

Return Value

mixed Previous value of the property.

in JObject at line 198
boolean setProperties(mixed $properties)

Set the object properties based on a named array/hash.

Parameters

mixed $properties Either an associative array or another object.

Return Value

boolean

See also

set()

in JObject at line 222
void setError(string $error)

Add an error message.

Parameters

string $error Error message.

Return Value

void

in JObject at line 235
string toString() deprecated

deprecated 12.1 Use magic method __toString()

Return Value

string

See also

__toString()

in JDocument at line 239
static object getInstance($type = 'html', $attributes = array())

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

Parameters

$type
$attributes

Return Value

object The document object.

in JDocument at line 293
setType(string $type)

Set the document type

Parameters

string $type

in JDocument at line 305
string getType()

Returns the document type

Return Value

string

in JDocument at line 316
The getBuffer()

Get the contents of the document buffer

Return Value

The contents of the document buffer

in JDocument at line 330
void setBuffer(string $content, array $options = array())

Set the contents of the document buffer

Parameters

string $content The content to be set in the buffer.
array $options Array of optional elements.

Return Value

void

in JDocument at line 344
string getMetaData(string $name, bool $http_equiv = false)

Gets a meta tag.

Parameters

string $name Value of name or http-equiv tag
bool $http_equiv META type "http-equiv" defaults to null

Return Value

string

in JDocument at line 377
void setMetaData(string $name, string $content, bool $http_equiv = false, bool $sync = true)

Sets or alters a meta tag.

Parameters

string $name Value of name or http-equiv tag
string $content Value of the content tag
bool $http_equiv META type "http-equiv" defaults to null
bool $sync Should http-equiv="content-type" by synced with HTTP-header?

Return Value

void

in JDocument at line 413
addScript(string $url, string $type = 'text/javascript', bool $defer = false, bool $async = false)

Adds a linked script to the page

Parameters

string $url URL to the linked script
string $type Type of script. Defaults to 'text/javascript'
bool $defer Adds the defer attribute.
bool $async Adds the async attribute.

in JDocument at line 430
void addScriptDeclaration(string $content, string $type = 'text/javascript')

Adds a script to the page

Parameters

string $content Script
string $type Scripting mime (defaults to 'text/javascript')

Return Value

void

in JDocument at line 452
void addStyleSheet(string $url, string $type = 'text/css', string $media = null, array $attribs = array())

Adds a linked stylesheet to the page

Parameters

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

Return Value

void

in JDocument at line 468
void addStyleDeclaration(string $content, string $type = 'text/css')

Adds a stylesheet declaration to the page

Parameters

string $content Style declarations
string $type Type of stylesheet (defaults to 'text/css')

Return Value

void

in JDocument at line 486
void setCharset(string $type = 'utf-8')

Sets the document charset

Parameters

string $type Charset encoding string

Return Value

void

in JDocument at line 496
string getCharset()

Returns the document charset encoding.

Return Value

string

in JDocument at line 508
void setLanguage(string $lang = 'en-gb')

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

Parameters

string $lang

Return Value

void

in JDocument at line 518
string getLanguage()

Returns the document language.

Return Value

string

in JDocument at line 530
void setDirection($dir = 'ltr')

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

Parameters

$dir

Return Value

void

in JDocument at line 541
string getDirection()

Returns the document direction declaration.

Return Value

string

in JDocument at line 553
void setTitle(string $title)

Sets the title of the document

Parameters

string $title

Return Value

void

in JDocument at line 564
string getTitle()

Return the title of the document.

Return Value

string

in JDocument at line 576
void setBase(string $base)

Sets the base URI of the document

Parameters

string $base

Return Value

void

in JDocument at line 588
string getBase()

Return the base URI of the document.

Return Value

string

in JDocument at line 600
void setDescription($description)

Sets the description of the document

Parameters

$description

Return Value

void

in JDocument at line 612
string getDescription()

Return the title of the page.

Return Value

string

Sets the document link

Parameters

string $url A url

Return Value

void

Returns the document base url

Return Value

string

in JDocument at line 647
void setGenerator(string $generator)

Sets the document generator

Parameters

string $generator

Return Value

void

in JDocument at line 658
string getGenerator()

Returns the document generator

Return Value

string

in JDocument at line 670
void setModifiedDate(string $date)

Sets the document modified date

Parameters

string $date

Return Value

void

in JDocument at line 681
string getModifiedDate()

Returns the document modified date

Return Value

string

in JDocument at line 700
void setMimeEncoding(string $type = 'text/html', bool $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.

Parameters

string $type
bool $sync Should the type be synced with HTML?

Return Value

void

in JDocument at line 716
string getMimeEncoding()

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

Return Value

string

in JDocument at line 728
void setLineEnd(string $style)

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

Parameters

string $style "win", "mac", "unix" or custom string.

Return Value

void

in JDocument at line 752
string _getLineEnd()

Returns the lineEnd

Return Value

string

in JDocument at line 764
void setTab(string $string)

Sets the string used to indent HTML

Parameters

string $string String used to indent ("\11", "\t", ' ', etc.).

Return Value

void

in JDocument at line 775
string _getTab()

Returns a string containing the unit for indenting HTML

Return Value

string

in JDocument at line 788
mixed loadRenderer(string $type)

Load a renderer

Parameters

string $type The renderer type

Return Value

mixed Object or null if class does not exist

in JDocument at line 817
null parse($params = array())

Parses the document and prepares the buffers

Parameters

$params

Return Value

null

at line 63
The render($cache = false, $params = array())

Render the document.

Parameters

$cache
$params

Return Value

The rendered data

at line 80
string getName()

Returns the document name

Return Value

string

at line 93
void setName(string $name = 'joomla')

Sets the document name

Parameters

string $name Document name

Return Value

void