public
|
#
__construct( array $options = array() )
Class constructor.
Parameters
- $options
array - $options Associative array of options
Since
11.1
|
public static
object
|
#
getInstance( string $type = 'html', array $attributes = array() )
Returns the global JDocument object, only creating it if it doesn't already
exist.
Returns the global JDocument object, only creating it if it doesn't already
exist.
Parameters
- $type
string - $type The document type to instantiate
- $attributes
array - $attributes Array of attributes
Returns
object - The document object.
Since
11.1
|
public
JDocument
|
#
setType( string $type )
Set the document type
Parameters
- $type
string - $type Type document is to set to
Returns
JDocument
- instance of $this to allow chaining
Since
11.1
|
public
string
|
#
getType( )
Returns the document type
Returns the document type
Returns
string
Since
11.1
|
public
mixed
|
#
getBuffer( )
Get the contents of the document buffer
Get the contents of the document buffer
Returns
mixed
Since
11.1
|
public
JDocument
|
#
setBuffer( string $content, array $options = array() )
Set the contents of the document buffer
Set the contents of the document buffer
Parameters
- $content
string - $content The content to be set in the buffer.
- $options
array - $options Array of optional elements.
Returns
JDocument
- instance of $this to allow chaining
Since
11.1
|
public
string
|
#
getMetaData( string $name, string $attribute = 'name' )
Gets a meta tag.
Parameters
- $name
string - $name Name of the meta HTML tag
- $attribute
string - $attribute Attribute to use in the meta HTML tag
Returns
string
Since
11.1
|
public
JDocument
|
#
setMetaData( string $name, string $content, string $attribute = 'name' )
Sets or alters a meta tag.
Sets or alters a meta tag.
Parameters
- $name
string - $name Name of the meta HTML tag
- $content
string - $content Value of the meta HTML tag
- $attribute
string - $attribute Attribute to use in the meta HTML tag
Returns
JDocument
- instance of $this to allow chaining
Since
11.1
|
public
JDocument
|
#
addScript( string $url, array $options = array(), array $attribs = array() )
Adds a linked script to the page
Adds a linked script to the page
Deprecated
4.0 The (url, mime, defer, async) method signature is deprecated, use (url,
options, attributes) instead.
Parameters
- $url
string - $url URL to the linked script.
- $options
array - $options Array of options. Example: array('version' => 'auto', 'conditional'
=> 'lt IE 9')
- $attribs
array - $attribs Array of attributes. Example: array('id' => 'scriptid', 'async'
=> 'async', 'data-test' => 1)
Returns
JDocument
- instance of $this to allow chaining
Since
11.1
|
public
JDocument
|
#
addScriptVersion( string $url, array $options = array(), array $attribs = array() )
Adds a linked script to the page with a version to allow to flush it. Ex:
myscript.js?54771616b5bceae9df03c6173babf11d If not specified Joomla!
automatically handles versioning
Adds a linked script to the page with a version to allow to flush it. Ex:
myscript.js?54771616b5bceae9df03c6173babf11d If not specified Joomla!
automatically handles versioning
Deprecated
4.0 This method is deprecated, use addScript(url, options, attributes) instead.
Parameters
- $url
string - $url URL to the linked script.
- $options
array - $options Array of options. Example: array('version' => 'auto', 'conditional'
=> 'lt IE 9')
- $attribs
array - $attribs Array of attributes. Example: array('id' => 'scriptid', 'async'
=> 'async', 'data-test' => 1)
Returns
JDocument
- instance of $this to allow chaining
Since
3.2
|
public
JDocument
|
#
addScriptDeclaration( string $content, string $type = 'text/javascript' )
Adds a script to the page
Adds a script to the page
Parameters
- $content
string - $content Script
- $type
string - $type Scripting mime (defaults to 'text/javascript')
Returns
JDocument
- instance of $this to allow chaining
Since
11.1
|
public
JDocument
|
#
addScriptOptions( string $key, mixed $options, boolean $merge = true )
Add option for script
Parameters
- $key
string - $key Name in Storage
- $options
mixed - $options Scrip options as array or string
- $merge
boolean - $merge Whether merge with existing (true) or replace (false)
Returns
JDocument
- instance of $this to allow chaining
Since
3.5
|
public
array
|
#
getScriptOptions( string $key = null )
Get script(s) options
Parameters
- $key
string - $key Name in Storage
Returns
array - Options for given $key, or all script options
Since
3.5
|
public
JDocument
|
#
addStyleSheet( string $url, array $options = array(), array $attribs = array() )
Adds a linked stylesheet to the page
Adds a linked stylesheet to the page
Deprecated
4.0 The (url, mime, media, attribs) method signature is deprecated, use (url,
options, attributes) instead.
Parameters
- $url
string - $url URL to the linked style sheet
- $options
array - $options Array of options. Example: array('version' => 'auto', 'conditional'
=> 'lt IE 9')
- $attribs
array - $attribs Array of attributes. Example: array('id' => 'stylesheet',
'data-test' => 1)
Returns
JDocument
- instance of $this to allow chaining
Since
11.1
|
public
JDocument
|
#
addStyleSheetVersion( string $url, array $options = array(), array $attribs = array() )
Adds a linked stylesheet version to the page. Ex:
template.css?54771616b5bceae9df03c6173babf11d If not specified Joomla!
automatically handles versioning
Adds a linked stylesheet version to the page. Ex:
template.css?54771616b5bceae9df03c6173babf11d If not specified Joomla!
automatically handles versioning
Deprecated
4.0 This method is deprecated, use addStyleSheet(url, options, attributes)
instead.
Parameters
- $url
string - $url URL to the linked style sheet
- $options
array - $options Array of options. Example: array('version' => 'auto', 'conditional'
=> 'lt IE 9')
- $attribs
array - $attribs Array of attributes. Example: array('id' => 'stylesheet',
'data-test' => 1)
Returns
JDocument
- instance of $this to allow chaining
Since
3.2
|
public
JDocument
|
#
addStyleDeclaration( string $content, string $type = 'text/css' )
Adds a stylesheet declaration to the page
Adds a stylesheet declaration to the page
Parameters
- $content
string - $content Style declarations
- $type
string - $type Type of stylesheet (defaults to 'text/css')
Returns
JDocument
- instance of $this to allow chaining
Since
11.1
|
public
JDocument
|
#
setCharset( string $type = 'utf-8' )
Sets the document charset
Sets the document charset
Parameters
- $type
string - $type Charset encoding string
Returns
JDocument
- instance of $this to allow chaining
Since
11.1
|
public
string
|
#
getCharset( )
Returns the document charset encoding.
Returns the document charset encoding.
Returns
string
Since
11.1
|
public
JDocument
|
#
setLanguage( string $lang = 'en-gb' )
Sets the global document language declaration. Default is English
(en-gb).
Sets the global document language declaration. Default is English
(en-gb).
Parameters
- $lang
string - $lang The language to be set
Returns
JDocument
- instance of $this to allow chaining
Since
11.1
|
public
string
|
#
getLanguage( )
Returns the document language.
Returns the document language.
Returns
string
Since
11.1
|
public
JDocument
|
#
setDirection( string $dir = 'ltr' )
Sets the global document direction declaration. Default is left-to-right
(ltr).
Sets the global document direction declaration. Default is left-to-right
(ltr).
Parameters
- $dir
string - $dir The language direction to be set
Returns
JDocument
- instance of $this to allow chaining
Since
11.1
|
public
string
|
#
getDirection( )
Returns the document direction declaration.
Returns the document direction declaration.
Returns
string
Since
11.1
|
public
JDocument
|
#
setTitle( string $title )
Sets the title of the document
Sets the title of the document
Parameters
- $title
string - $title The title to be set
Returns
JDocument
- instance of $this to allow chaining
Since
11.1
|
public
string
|
#
getTitle( )
Return the title of the document.
Return the title of the document.
Returns
string
Since
11.1
|
public
JDocument
|
#
setMediaVersion( string $mediaVersion )
Set the assets version
Parameters
- $mediaVersion
string - $mediaVersion Media version to use
Returns
JDocument
- instance of $this to allow chaining
Since
3.2
|
public
string
|
|
public
JDocument
|
#
setBase( string $base )
Sets the base URI of the document
Sets the base URI of the document
Parameters
- $base
string - $base The base URI to be set
Returns
JDocument
- instance of $this to allow chaining
Since
11.1
|
public
string
|
#
getBase( )
Return the base URI of the document.
Return the base URI of the document.
Returns
string
Since
11.1
|
public
JDocument
|
#
setDescription( string $description )
Sets the description of the document
Sets the description of the document
Parameters
- $description
string - $description The description to set
Returns
JDocument
- instance of $this to allow chaining
Since
11.1
|
public
string
|
#
getDescription( )
Return the title of the page.
Return the title of the page.
Returns
string
Since
11.1
|
public
JDocument
|
#
setLink( string $url )
Sets the document link
Parameters
Returns
JDocument
- instance of $this to allow chaining
Since
11.1
|
public
string
|
#
getLink( )
Returns the document base url
Returns the document base url
Returns
string
Since
11.1
|
public
JDocument
|
#
setGenerator( string $generator )
Sets the document generator
Sets the document generator
Parameters
- $generator
string - $generator The generator to be set
Returns
JDocument
- instance of $this to allow chaining
Since
11.1
|
public
string
|
#
getGenerator( )
Returns the document generator
Returns the document generator
Returns
string
Since
11.1
|
public
JDocument
|
#
setModifiedDate( string $date )
Sets the document modified date
Sets the document modified date
Parameters
- $date
string - $date The date to be set
Returns
JDocument
- instance of $this to allow chaining
Since
11.1
|
public
string
|
#
getModifiedDate( )
Returns the document modified date
Returns the document modified date
Returns
string
Since
11.1
|
public
JDocument
|
#
setMimeEncoding( string $type = 'text/html', boolean $sync = true )
Sets the document MIME encoding that is sent to the browser.
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
- $type
string - $type The document type to be sent
- $sync
boolean - $sync Should the type be synced with HTML?
Returns
JDocument
- instance of $this to allow chaining
Since
11.1
Link
|
public
string
|
#
getMimeEncoding( )
Return the document MIME encoding that is sent to the browser.
Return the document MIME encoding that is sent to the browser.
Returns
string
Since
11.1
|
public
JDocument
|
#
setLineEnd( string $style )
Sets the line end style to Windows, Mac, Unix or a custom string.
Sets the line end style to Windows, Mac, Unix or a custom string.
Parameters
- $style
string - $style "win", "mac", "unix" or custom string.
Returns
JDocument
- instance of $this to allow chaining
Since
11.1
|
public
string
|
#
_getLineEnd( )
Returns the lineEnd
Returns
string
Since
11.1
|
public
JDocument
|
#
setTab( string $string )
Sets the string used to indent HTML
Sets the string used to indent HTML
Parameters
- $string
string - $string String used to indent ("\11", "\t", ' ', etc.).
Returns
JDocument
- instance of $this to allow chaining
Since
11.1
|
public
string
|
#
_getTab( )
Returns a string containing the unit for indenting HTML
Returns a string containing the unit for indenting HTML
Returns
string
Since
11.1
|
public
JDocumentRenderer
|
#
loadRenderer( string $type )
Load a renderer
Parameters
- $type
string - $type The renderer type
Returns
Throws
Since
11.1
|
public
JDocument
|
#
parse( array $params = array() )
Parses the document and prepares the buffers
Parses the document and prepares the buffers
Parameters
- $params
array - $params The array of parameters
Returns
JDocument
- instance of $this to allow chaining
Since
11.1
|
public
The
|
#
render( boolean $cache = false, array $params = array() )
Outputs the document
Parameters
- $cache
boolean - $cache If true, cache the output
- $params
array - $params Associative array of attributes
Returns
The - rendered data
Since
11.1
|
public
string
|
$title
|
#
Document title
Since
11.1
|
public
string
|
$description
|
#
Document description
Since
11.1
|
public
string
|
$link
|
#
Document full URL
Since
11.1
|
public
string
|
$base
|
#
Document base URL
Since
11.1
|
public
string
|
$language
|
#
Contains the document language setting
Contains the document language setting
Since
11.1
|
public
string
|
$direction
|
#
Contains the document direction setting
Contains the document direction setting
Since
11.1
|
public
string
|
$_generator
|
|
public
string
|
$_mdate
|
#
Document modified date
Since
11.1
|
public
string
|
$_tab
|
|
public
string
|
$_lineEnd
|
#
Contains the line end string
Contains the line end string
Since
11.1
|
public
string
|
$_charset
|
#
Contains the character encoding string
Contains the character encoding string
Since
11.1
|
public
string
|
$_mime
|
#
Document mime type
Since
11.1
|
public
string
|
$_namespace
|
#
Document namespace
Since
11.1
|
public
string
|
$_profile
|
#
Document profile
Since
11.1
|
public
array
|
$_scripts
|
#
Array of linked scripts
Since
11.1
|
public
array
|
$_script
|
#
Array of scripts placed in the header
Array of scripts placed in the header
Since
11.1
|
protected
array
|
$scriptOptions
|
|
public
array
|
$_styleSheets
|
#
Array of linked style sheets
Array of linked style sheets
Since
11.1
|
public
array
|
$_style
|
#
Array of included style declarations
Array of included style declarations
Since
11.1
|
public
array
|
$_metaTags
|
#
Array of meta tags
Since
11.1
|
public
object
|
$_engine
|
#
The rendering engine
Since
11.1
|
public
string
|
$_type
|
#
The document type
Since
11.1
|
public static
mixed
|
$_buffer
|
#
Array of buffered output
Since
11.1
|
protected static
array
|
$instances
|
#
JDocument instances container.
JDocument instances container.
Since
11.3
|
protected
string
|
$mediaVersion
|
#
Media version added to assets
Media version added to assets
Since
3.2
|