Joomla CMS  3.10.11 (avec JPlatform 13.1 inclus)
Documentation des API du CMS Joomla en version 3.10.11 et du framework Joomla Platform intégré
Tout Structures de données Espaces de nommage Fichiers Fonctions Variables Pages
Référence de la classe Document
+ Graphe d'héritage de Document:

Fonctions membres publiques

 __construct ($options=array())
 
 setType ($type)
 
 getType ()
 
 getBuffer ()
 
 setBuffer ($content, $options=array())
 
 getMetaData ($name, $attribute='name')
 
 setMetaData ($name, $content, $attribute='name')
 
 addScript ($url, $options=array(), $attribs=array())
 
 addScriptVersion ($url, $options=array(), $attribs=array())
 
 addScriptDeclaration ($content, $type='text/javascript')
 
 addScriptOptions ($key, $options, $merge=true)
 
 getScriptOptions ($key=null)
 
 addStyleSheet ($url, $options=array(), $attribs=array())
 
 addStyleSheetVersion ($url, $options=array(), $attribs=array())
 
 addStyleDeclaration ($content, $type='text/css')
 
 setCharset ($type='utf-8')
 
 getCharset ()
 
 setLanguage ($lang='en-gb')
 
 getLanguage ()
 
 setDirection ($dir='ltr')
 
 getDirection ()
 
 setTitle ($title)
 
 getTitle ()
 
 setMediaVersion ($mediaVersion)
 
 getMediaVersion ()
 
 setBase ($base)
 
 getBase ()
 
 setDescription ($description)
 
 getDescription ()
 
 setLink ($url)
 
 getLink ()
 
 setGenerator ($generator)
 
 getGenerator ()
 
 setModifiedDate ($date)
 
 getModifiedDate ()
 
 setMimeEncoding ($type='text/html', $sync=true)
 
 getMimeEncoding ()
 
 setLineEnd ($style)
 
 _getLineEnd ()
 
 setTab ($string)
 
 _getTab ()
 
 loadRenderer ($type)
 
 parse ($params=array())
 
 render ($cache=false, $params=array())
 

Fonctions membres publiques statiques

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

Champs de données

 $title = ''
 
 $description = ''
 
 $link = ''
 
 $base = ''
 
 $language = 'en-gb'
 
 $direction = 'ltr'
 
 $_generator = 'Joomla! - Open Source Content Management'
 
 $_mdate = ''
 
 $_tab = "\11"
 
 $_lineEnd = "\12"
 
 $_charset = 'utf-8'
 
 $_mime = ''
 
 $_namespace = ''
 
 $_profile = ''
 
 $_scripts = array()
 
 $_script = array()
 
 $_styleSheets = array()
 
 $_style = array()
 
 $_metaTags = array()
 
 $_engine = null
 
 $_type = null
 

Attributs publics statiques

static $_buffer = null
 

Attributs protégés

 $scriptOptions = array()
 
 $mediaVersion = null
 

Attributs protégés statiques

static $instances = array()
 

Description détaillée

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

Depuis
1.7.0

Documentation des constructeurs et destructeur

◆ __construct()

__construct (   $options = array())

Class constructor.

Paramètres
array$optionsAssociative array of options
Depuis
1.7.0

Références $options.

Documentation des fonctions membres

◆ _getLineEnd()

_getLineEnd ( )

Returns the lineEnd

Renvoie
string
Depuis
1.7.0

◆ _getTab()

_getTab ( )

Returns a string containing the unit for indenting HTML

Renvoie
string
Depuis
1.7.0

◆ addScript()

addScript (   $url,
  $options = array(),
  $attribs = array() 
)

Adds a linked script to the page

Paramètres
string$urlURL to the linked script.
array$optionsArray of options. Example: array('version' => 'auto', 'conditional' => 'lt IE 9')
array$attribsArray of attributes. Example: array('id' => 'scriptid', 'async' => 'async', 'data-test' => 1)
Renvoie
Document instance of $this to allow chaining
Depuis
1.7.0
Obsolète:
4.0 The (url, mime, defer, async) method signature is deprecated, use (url, options, attributes) instead.

Références $attribs, $options, et $url.

◆ addScriptDeclaration()

addScriptDeclaration (   $content,
  $type = 'text/javascript' 
)

Adds a script to the page

Paramètres
string$contentScript
string$typeScripting mime (defaults to 'text/javascript')
Renvoie
Document instance of $this to allow chaining
Depuis
1.7.0

Références $content, et $type.

◆ addScriptOptions()

addScriptOptions (   $key,
  $options,
  $merge = true 
)

Add option for script

Paramètres
string$keyName in Storage
mixed$optionsScrip options as array or string
bool$mergeWhether merge with existing (true) or replace (false)
Renvoie
Document instance of $this to allow chaining
Depuis
3.5

Références $key, et $options.

◆ addScriptVersion()

addScriptVersion (   $url,
  $options = 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

Paramètres
string$urlURL to the linked script.
array$optionsArray of options. Example: array('version' => 'auto', 'conditional' => 'lt IE 9')
array$attribsArray of attributes. Example: array('id' => 'scriptid', 'async' => 'async', 'data-test' => 1)
Renvoie
Document instance of $this to allow chaining
Depuis
3.2
Obsolète:
4.0 This method is deprecated, use addScript(url, options, attributes) instead.

Références $attribs, $options, et $url.

◆ addStyleDeclaration()

addStyleDeclaration (   $content,
  $type = 'text/css' 
)

Adds a stylesheet declaration to the page

Paramètres
string$contentStyle declarations
string$typeType of stylesheet (defaults to 'text/css')
Renvoie
Document instance of $this to allow chaining
Depuis
1.7.0

Références $content, et $type.

◆ addStyleSheet()

addStyleSheet (   $url,
  $options = array(),
  $attribs = array() 
)

Adds a linked stylesheet to the page

Paramètres
string$urlURL to the linked style sheet
array$optionsArray of options. Example: array('version' => 'auto', 'conditional' => 'lt IE 9')
array$attribsArray of attributes. Example: array('id' => 'stylesheet', 'data-test' => 1)
Renvoie
Document instance of $this to allow chaining
Depuis
1.7.0
Obsolète:
4.0 The (url, mime, media, attribs) method signature is deprecated, use (url, options, attributes) instead.

Références $attribs, $options, et $url.

◆ addStyleSheetVersion()

addStyleSheetVersion (   $url,
  $options = array(),
  $attribs = array() 
)

Adds a linked stylesheet version to the page. Ex: template.css?54771616b5bceae9df03c6173babf11d If not specified Joomla! automatically handles versioning

Paramètres
string$urlURL to the linked style sheet
array$optionsArray of options. Example: array('version' => 'auto', 'conditional' => 'lt IE 9')
array$attribsArray of attributes. Example: array('id' => 'stylesheet', 'data-test' => 1)
Renvoie
Document instance of $this to allow chaining
Depuis
3.2
Obsolète:
4.0 This method is deprecated, use addStyleSheet(url, options, attributes) instead.

Références $attribs, $options, et $url.

◆ getBase()

getBase ( )

Return the base URI of the document.

Renvoie
string
Depuis
1.7.0

Références $base.

◆ getBuffer()

getBuffer ( )

Get the contents of the document buffer

Renvoie
mixed
Depuis
1.7.0

◆ getCharset()

getCharset ( )

Returns the document charset encoding.

Renvoie
string
Depuis
1.7.0

◆ getDescription()

getDescription ( )

Return the description of the document.

Renvoie
string
Depuis
1.7.0

Références $description.

◆ getDirection()

getDirection ( )

Returns the document direction declaration.

Renvoie
string
Depuis
1.7.0

Références $direction.

◆ getGenerator()

getGenerator ( )

Returns the document generator

Renvoie
string
Depuis
1.7.0

◆ getInstance()

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

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

Paramètres
string$typeThe document type to instantiate
array$attributesArray of attributes
Renvoie
object The document object.
Depuis
1.7.0

Références $attributes, $class, $path, $type, null, et JLoader\register().

Référencé par ExceptionHandler\render().

◆ getLanguage()

getLanguage ( )

Returns the document language.

Renvoie
string
Depuis
1.7.0

Références $language.

◆ getLink()

getLink ( )

Returns the document base url

Renvoie
string
Depuis
1.7.0

Références $link.

◆ getMediaVersion()

getMediaVersion ( )

Return the media version

Renvoie
string
Depuis
3.2

◆ getMetaData()

getMetaData (   $name,
  $attribute = 'name' 
)

Gets a meta tag.

Paramètres
string$nameName of the meta HTML tag
string$attributeAttribute to use in the meta HTML tag
Renvoie
string
Depuis
1.7.0

Références $name, et elseif.

◆ getMimeEncoding()

getMimeEncoding ( )

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

Renvoie
string
Depuis
1.7.0

◆ getModifiedDate()

getModifiedDate ( )

Returns the document modified date

Renvoie
string|Date
Depuis
1.7.0

◆ getScriptOptions()

getScriptOptions (   $key = null)

Get script(s) options

Paramètres
string$keyName in Storage
Renvoie
array Options for given $key, or all script options
Depuis
3.5

Références $key.

◆ getTitle()

getTitle ( )

Return the title of the document.

Renvoie
string
Depuis
1.7.0

Références $title.

◆ getType()

getType ( )

Returns the document type

Renvoie
string
Depuis
1.7.0

◆ loadRenderer()

loadRenderer (   $type)

Load a renderer

Paramètres
string$typeThe renderer type
Renvoie
DocumentRenderer
Depuis
1.7.0
Exceptions

Références $class, $path, $type, et JLoader\register().

◆ parse()

parse (   $params = array())

Parses the document and prepares the buffers

Paramètres
array$paramsThe array of parameters
Renvoie
Document instance of $this to allow chaining
Depuis
1.7.0

◆ render()

render (   $cache = false,
  $params = array() 
)

Outputs the document

Paramètres
boolean$cacheIf true, cache the output
array$paramsAssociative array of attributes
Renvoie
void The rendered data
Depuis
1.7.0

Références $app.

◆ setBase()

setBase (   $base)

Sets the base URI of the document

Paramètres
string$baseThe base URI to be set
Renvoie
Document instance of $this to allow chaining
Depuis
1.7.0

Références $base.

◆ setBuffer()

setBuffer (   $content,
  $options = array() 
)

Set the contents of the document buffer

Paramètres
string$contentThe content to be set in the buffer.
array$optionsArray of optional elements.
Renvoie
Document instance of $this to allow chaining
Depuis
1.7.0

Références $content.

◆ setCharset()

setCharset (   $type = 'utf-8')

Sets the document charset

Paramètres
string$typeCharset encoding string
Renvoie
Document instance of $this to allow chaining
Depuis
1.7.0

Références $type.

◆ setDescription()

setDescription (   $description)

Sets the description of the document

Paramètres
string$descriptionThe description to set
Renvoie
Document instance of $this to allow chaining
Depuis
1.7.0

Références $description, et description.

◆ setDirection()

setDirection (   $dir = 'ltr')

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

Paramètres
string$dirThe language direction to be set
Renvoie
Document instance of $this to allow chaining
Depuis
1.7.0

◆ setGenerator()

setGenerator (   $generator)

Sets the document generator

Paramètres
string$generatorThe generator to be set
Renvoie
Document instance of $this to allow chaining
Depuis
1.7.0

◆ setLanguage()

setLanguage (   $lang = 'en-gb')

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

Paramètres
string$langThe language to be set
Renvoie
Document instance of $this to allow chaining
Depuis
1.7.0

Références $lang, et language.

◆ setLineEnd()

setLineEnd (   $style)

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

Paramètres
string$style"win", "mac", "unix" or custom string.
Renvoie
Document instance of $this to allow chaining
Depuis
1.7.0

Références $style.

◆ setLink()

setLink (   $url)

Sets the document link

Paramètres
string$urlA url
Renvoie
Document instance of $this to allow chaining
Depuis
1.7.0

Références $url.

◆ setMediaVersion()

setMediaVersion (   $mediaVersion)

Set the assets version

Paramètres
string$mediaVersionMedia version to use
Renvoie
Document instance of $this to allow chaining
Depuis
3.2

◆ setMetaData()

setMetaData (   $name,
  $content,
  $attribute = 'name' 
)

Sets or alters a meta tag.

Paramètres
string$nameName of the meta HTML tag
mixed$contentValue of the meta HTML tag as array or string
string$attributeAttribute to use in the meta HTML tag
Renvoie
Document instance of $this to allow chaining
Depuis
1.7.0

Références $content, $name, et elseif.

◆ setMimeEncoding()

setMimeEncoding (   $type = 'text/html',
  $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 (http://www.w3.org/TR/xhtml-media-types/) for more details.

Paramètres
string$typeThe document type to be sent
boolean$syncShould the type be synced with HTML?
Renvoie
Document instance of $this to allow chaining
Depuis
1.7.0

http://www.w3.org/TR/xhtml-media-types

Références $type.

◆ setModifiedDate()

setModifiedDate (   $date)

Sets the document modified date

Paramètres
string | Date$dateThe date to be set
Renvoie
Document instance of $this to allow chaining
Depuis
1.7.0
Exceptions

Références $date.

◆ setTab()

setTab (   $string)

Sets the string used to indent HTML

Paramètres
string$stringString used to indent ("\11", "\t", ' ', etc.).
Renvoie
Document instance of $this to allow chaining
Depuis
1.7.0

◆ setTitle()

setTitle (   $title)

Sets the title of the document

Paramètres
string$titleThe title to be set
Renvoie
Document instance of $this to allow chaining
Depuis
1.7.0

Références $title, et title.

◆ setType()

setType (   $type)

Set the document type

Paramètres
string$typeType document is to set to
Renvoie
Document instance of $this to allow chaining
Depuis
1.7.0

Références $type.

Documentation des champs

◆ $_buffer

$_buffer = null
static

◆ $_charset

$_charset = 'utf-8'

◆ $_engine

$_engine = null

◆ $_generator

$_generator = 'Joomla! - Open Source Content Management'

◆ $_lineEnd

$_lineEnd = "\12"

◆ $_mdate

$_mdate = ''

◆ $_metaTags

$_metaTags = array()

◆ $_mime

$_mime = ''

◆ $_namespace

$_namespace = ''

◆ $_profile

$_profile = ''

◆ $_script

$_script = array()

◆ $_scripts

$_scripts = array()

◆ $_style

$_style = array()

◆ $_styleSheets

$_styleSheets = array()

◆ $_tab

$_tab = "\11"

◆ $_type

$_type = null

◆ $base

$base = ''

◆ $description

$description = ''

◆ $direction

$direction = 'ltr'

◆ $instances

$instances = array()
staticprotected

◆ $language

$language = 'en-gb'

◆ $link

$link = ''

◆ $mediaVersion

$mediaVersion = null
protected

◆ $scriptOptions

$scriptOptions = array()
protected

◆ $title

$title = ''

La documentation de cette classe a été générée à partir du fichier suivant :