OpensearchDocument
Extends DocumentOpensearch class, provides an easy interface to display an Opensearch document
link | |
---|---|
since |
1.7.0 |
package |
Joomla CMS |
Methods
__construct
Class constructor.
__construct(array options = array()) : mixed
since |
1.7.0 |
---|
Arguments
- options
array
Associative array of options
Response
mixed
_getLineEnd
Returns the lineEnd
_getLineEnd() : string
since |
1.7.0 |
---|
Response
string
_getTab
Returns a string containing the unit for indenting HTML
_getTab() : string
since |
1.7.0 |
---|
Response
string
addImage
Adds an image to the Opensearch description.
addImage(\Joomla\CMS\Document\Opensearch\OpensearchImage image) : \Joomla\CMS\Document\OpensearchDocument
since |
1.7.0 |
---|
Arguments
- image
\Joomla\CMS\Document\Opensearch\OpensearchImage
The image to add to the description.
Response
\Joomla\CMS\Document\OpensearchDocument
instance of $this to allow chaining
addScript
Adds a linked script to the page
addScript(string url, array options = array(), array attribs = array()) : \Joomla\CMS\Document\Document
since |
1.7.0 |
---|---|
deprecated |
5.0 Use WebAssetManager |
Arguments
- url
string
URL to the linked script.- options
array
Array of options. Example: array('version' => 'auto', 'conditional' => 'lt IE 9', 'preload' => array('preload'))- attribs
array
Array of attributes. Example: array('id' => 'scriptid', 'async' => 'async', 'data-test' => 1)
Response
\Joomla\CMS\Document\Document
instance of $this to allow chaining
addScriptDeclaration
Adds a script to the page
addScriptDeclaration(string content, string type = 'text/javascript') : \Joomla\CMS\Document\Document
since |
1.7.0 |
---|---|
deprecated |
5.0 Use WebAssetManager |
Arguments
- content
string
Script- type
string
Scripting mime (defaults to 'text/javascript')
Response
\Joomla\CMS\Document\Document
instance of $this to allow chaining
addScriptOptions
Add option for script
addScriptOptions(string key, mixed options, bool merge = true) : \Joomla\CMS\Document\Document
since |
3.5 |
---|
Arguments
- key
string
Name in Storage- options
mixed
Scrip options as array or string- merge
bool
Whether merge with existing (true) or replace (false)
Response
\Joomla\CMS\Document\Document
instance of $this to allow chaining
addStyleDeclaration
Adds a stylesheet declaration to the page
addStyleDeclaration(string content, string type = 'text/css') : \Joomla\CMS\Document\Document
since |
1.7.0 |
---|---|
deprecated |
5.0 Use WebAssetManager |
Arguments
- content
string
Style declarations- type
string
Type of stylesheet (defaults to 'text/css')
Response
\Joomla\CMS\Document\Document
instance of $this to allow chaining
addStyleSheet
Adds a linked stylesheet to the page
addStyleSheet(string url, array options = array(), array attribs = array()) : \Joomla\CMS\Document\Document
since |
1.7.0 |
---|---|
deprecated |
5.0 Use WebAssetManager |
Arguments
- url
string
URL to the linked style sheet- options
array
Array of options. Example: array('version' => 'auto', 'conditional' => 'lt IE 9', 'preload' => array('preload'))- attribs
array
Array of attributes. Example: array('id' => 'stylesheet', 'data-test' => 1)
Response
\Joomla\CMS\Document\Document
instance of $this to allow chaining
addUrl
Adds a URL to the Opensearch description.
addUrl(\Joomla\CMS\Document\Opensearch\OpensearchUrl url) : \Joomla\CMS\Document\OpensearchDocument
since |
1.7.0 |
---|
Arguments
- url
\Joomla\CMS\Document\Opensearch\OpensearchUrl
The url to add to the description.
Response
\Joomla\CMS\Document\OpensearchDocument
instance of $this to allow chaining
getBase
Return the base URI of the document.
getBase() : string
since |
1.7.0 |
---|
Response
string
getBuffer
Get the contents of the document buffer
getBuffer() : mixed
since |
1.7.0 |
---|
Response
mixed
getCharset
Returns the document charset encoding.
getCharset() : string
since |
1.7.0 |
---|
Response
string
getDescription
Return the description of the document.
getDescription() : string
since |
1.7.0 |
---|
Response
string
getDirection
Returns the document direction declaration.
getDirection() : string
since |
1.7.0 |
---|
Response
string
getGenerator
Returns the document generator
getGenerator() : string
since |
1.7.0 |
---|
Response
string
getInstance
Returns the global Document object, only creating it if it doesn't already exist.
getInstance(string type = 'html', array attributes = array()) : static
since |
1.7.0 |
---|---|
deprecated |
5.0 Use the \Joomla\CMS\Document\FactoryInterface instead |
Arguments
- type
string
The document type to instantiate- attributes
array
Array of attributes
Response
static
The document object.
getLanguage
Returns the document language.
getLanguage() : string
since |
1.7.0 |
---|
Response
string
getLink
Returns the document base url
getLink() : string
since |
1.7.0 |
---|
Response
string
getMediaVersion
Return the media version
getMediaVersion() : string
since |
3.2 |
---|
Response
string
getMetaData
Gets a meta tag.
getMetaData(string name, string attribute = 'name') : string
since |
1.7.0 |
---|
Arguments
- name
string
Name of the meta HTML tag- attribute
string
Attribute to use in the meta HTML tag
Response
string
getMimeEncoding
Return the document MIME encoding that is sent to the browser.
getMimeEncoding() : string
since |
1.7.0 |
---|
Response
string
getModifiedDate
Returns the document modified date
getModifiedDate() : string|\Joomla\CMS\Date\Date
since |
1.7.0 |
---|
Response
string|\Joomla\CMS\Date\Date
getPreloadManager
Return the preload manager
getPreloadManager() : \Joomla\CMS\Document\PreloadManagerInterface
since |
4.0.0 |
---|
Response
\Joomla\CMS\Document\PreloadManagerInterface
getScriptOptions
Get script(s) options
getScriptOptions(string key = null) : array
since |
3.5 |
---|
Arguments
- key
string
Name in Storage
Response
array
Options for given $key, or all script options
getTitle
Return the title of the document.
getTitle() : string
since |
1.7.0 |
---|
Response
string
getType
Returns the document type
getType() : string
since |
1.7.0 |
---|
Response
string
getWebAssetManager
Return WebAsset manager
getWebAssetManager() : \Joomla\CMS\WebAsset\WebAssetManager
since |
4.0.0 |
---|
Response
\Joomla\CMS\WebAsset\WebAssetManager
loadRenderer
Load a renderer
loadRenderer(string type) : \Joomla\CMS\Document\RendererInterface
since |
1.7.0 |
---|---|
throws |
|
Arguments
- type
string
The renderer type
Response
\Joomla\CMS\Document\RendererInterface
parse
Parses the document and prepares the buffers
parse(array params = array()) : \Joomla\CMS\Document\Document
since |
1.7.0 |
---|
Arguments
- params
array
The array of parameters
Response
\Joomla\CMS\Document\Document
instance of $this to allow chaining
preloadAssets
Generate the Link header for assets configured for preloading
preloadAssets() : void
since |
4.0.0 |
---|
render
Outputs the document
render(bool cache = false, array params = array()) : string
since |
1.7.0 |
---|
Arguments
- cache
bool
If true, cache the output- params
array
Associative array of attributes
Response
string
The rendered data
setBase
Sets the base URI of the document
setBase(string base) : \Joomla\CMS\Document\Document
since |
1.7.0 |
---|
Arguments
- base
string
The base URI to be set
Response
\Joomla\CMS\Document\Document
instance of $this to allow chaining
setBuffer
Set the contents of the document buffer
setBuffer(string content, array options = array()) : \Joomla\CMS\Document\Document
since |
1.7.0 |
---|
Arguments
- content
string
The content to be set in the buffer.- options
array
Array of optional elements.
Response
\Joomla\CMS\Document\Document
instance of $this to allow chaining
setCharset
Sets the document charset
setCharset(string type = 'utf-8') : \Joomla\CMS\Document\Document
since |
1.7.0 |
---|
Arguments
- type
string
Charset encoding string
Response
\Joomla\CMS\Document\Document
instance of $this to allow chaining
setDescription
Sets the description of the document
setDescription(string description) : \Joomla\CMS\Document\Document
since |
1.7.0 |
---|
Arguments
- description
string
The description to set
Response
\Joomla\CMS\Document\Document
instance of $this to allow chaining
setDirection
Sets the global document direction declaration. Default is left-to-right (ltr).
setDirection(string dir = 'ltr') : \Joomla\CMS\Document\Document
since |
1.7.0 |
---|
Arguments
- dir
string
The language direction to be set
Response
\Joomla\CMS\Document\Document
instance of $this to allow chaining
setFactory
Set the factory instance
setFactory(\Joomla\CMS\Document\FactoryInterface factory) : \Joomla\CMS\Document\Document
since |
4.0.0 |
---|
Arguments
- factory
\Joomla\CMS\Document\FactoryInterface
The factory instance
Response
\Joomla\CMS\Document\Document
setGenerator
Sets the document generator
setGenerator(string generator) : \Joomla\CMS\Document\Document
since |
1.7.0 |
---|
Arguments
- generator
string
The generator to be set
Response
\Joomla\CMS\Document\Document
instance of $this to allow chaining
setLanguage
Sets the global document language declaration. Default is English (en-gb).
setLanguage(string lang = 'en-gb') : \Joomla\CMS\Document\Document
since |
1.7.0 |
---|
Arguments
- lang
string
The language to be set
Response
\Joomla\CMS\Document\Document
instance of $this to allow chaining
setLineEnd
Sets the line end style to Windows, Mac, Unix or a custom string.
setLineEnd(string style) : \Joomla\CMS\Document\Document
since |
1.7.0 |
---|
Arguments
- style
string
"win", "mac", "unix" or custom string.
Response
\Joomla\CMS\Document\Document
instance of $this to allow chaining
setLink
Sets the document link
setLink(string url) : \Joomla\CMS\Document\Document
since |
1.7.0 |
---|
Arguments
- url
string
A url
Response
\Joomla\CMS\Document\Document
instance of $this to allow chaining
setMediaVersion
Set the assets version
setMediaVersion(string mediaVersion) : \Joomla\CMS\Document\Document
since |
3.2 |
---|
Arguments
- mediaVersion
string
Media version to use
Response
\Joomla\CMS\Document\Document
instance of $this to allow chaining
setMetaData
Sets or alters a meta tag.
setMetaData(string name, mixed content, string attribute = 'name') : \Joomla\CMS\Document\Document
since |
1.7.0 |
---|
Arguments
- name
string
Name of the meta HTML tag- content
mixed
Value of the meta HTML tag as array or string- attribute
string
Attribute to use in the meta HTML tag
Response
\Joomla\CMS\Document\Document
instance of $this to allow chaining
setMimeEncoding
Sets the document MIME encoding that is sent to the browser.
setMimeEncoding(string type = 'text/html', bool sync = true) : \Joomla\CMS\Document\Document
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 https://www.w3.org/TR/xhtml-media-types/}) for more details.
since |
1.7.0 |
---|---|
link |
Arguments
- type
string
The document type to be sent- sync
bool
Should the type be synced with HTML?
Response
\Joomla\CMS\Document\Document
instance of $this to allow chaining
setModifiedDate
Sets the document modified date
setModifiedDate(string|\Joomla\CMS\Date\Date date) : \Joomla\CMS\Document\Document
since |
1.7.0 |
---|---|
throws |
|
Arguments
- date
string|\Joomla\CMS\Date\Date
The date to be set
Response
\Joomla\CMS\Document\Document
instance of $this to allow chaining
setPreloadManager
Set the preload manager
setPreloadManager(\Joomla\CMS\Document\PreloadManagerInterface preloadManager) : \Joomla\CMS\Document\Document
since |
4.0.0 |
---|
Arguments
- preloadManager
\Joomla\CMS\Document\PreloadManagerInterface
The preload manager service
Response
\Joomla\CMS\Document\Document
instance of $this to allow chaining
setShortName
Sets the short name
setShortName(string name) : \Joomla\CMS\Document\OpensearchDocument
since |
1.7.0 |
---|
Arguments
- name
string
The name.
Response
\Joomla\CMS\Document\OpensearchDocument
instance of $this to allow chaining
setTab
Sets the string used to indent HTML
setTab(string string) : \Joomla\CMS\Document\Document
since |
1.7.0 |
---|
Arguments
- string
string
String used to indent ("\11", "\t", ' ', etc.).
Response
\Joomla\CMS\Document\Document
instance of $this to allow chaining
setTitle
Sets the title of the document
setTitle(string title) : \Joomla\CMS\Document\Document
since |
1.7.0 |
---|
Arguments
- title
string
The title to be set
Response
\Joomla\CMS\Document\Document
instance of $this to allow chaining
setType
Set the document type
setType(string type) : \Joomla\CMS\Document\Document
since |
1.7.0 |
---|
Arguments
- type
string
Type document is to set to
Response
\Joomla\CMS\Document\Document
instance of $this to allow chaining
setWebAssetManager
Set WebAsset manager
setWebAssetManager(\Joomla\CMS\WebAsset\WebAssetManager webAsset) : \Joomla\CMS\Document\Document
since |
4.0.0 |
---|
Arguments
- webAsset
\Joomla\CMS\WebAsset\WebAssetManager
The WebAsset instance
Response
\Joomla\CMS\Document\Document
Properties
_scripts
Array of linked scripts
_script
Array of scripts placed in the header
_styleSheets
Array of linked style sheets
_style
Array of included style declarations