FeedDocument

Extends Document

FeedDocument class, provides an easy interface to parse and display any feed document

since

1.7.0

package

Joomla CMS

Methods

__construct

Class constructor

__construct(mixed||string|int options = []) : 
since

1.7.0

Arguments

options

array<string|int, mixed>Associative array of options

Response

mixed

_getLineEnd

Returns the lineEnd

_getLineEnd() : 
inherited
since

1.7.0

Response

string

_getTab

Returns a string containing the unit for indenting HTML

_getTab() : 
inherited
since

1.7.0

Response

string

addItem

Adds a FeedItem to the feed.

addItem(\Joomla\CMS\Document\Feed\FeedItem item) : \Joomla\CMS\Document\FeedDocument
since

1.7.0

Arguments

item

FeedItemThe feeditem to add to the feed.

Response

FeedDocumentinstance of $this to allow chaining

addScript

Adds a linked script to the page

addScript( url, mixed||string|int options = [], mixed||string|int attribs = []) : \Joomla\CMS\Document\Document
inherited deprecated
since

1.7.0

deprecated

4.3 will be removed in 6.0 Use WebAssetManager Example: $wa->registerAndUseScript(...);

Arguments

url

stringURL to the linked script.

options

array<string|int, mixed>Array of options. Example: array('version' => 'auto', 'conditional' => 'lt IE 9', 'preload' => array('preload'))

attribs

array<string|int, mixed>Array of attributes. Example: array('id' => 'scriptid', 'async' => 'async', 'data-test' => 1)

Response

Documentinstance of $this to allow chaining

addScriptDeclaration

Adds a script to the page

addScriptDeclaration( content,  type = 'text/javascript') : \Joomla\CMS\Document\Document
inherited deprecated
since

1.7.0

deprecated

4.3 will be removed in 6.0 Use WebAssetManager Example: $wa->addInlineScript(...);

Arguments

content

stringScript

type

stringScripting mime (defaults to 'text/javascript')

Response

Documentinstance of $this to allow chaining

addScriptOptions

Add option for script

addScriptOptions( key,  options,  merge = true) : \Joomla\CMS\Document\Document
inherited
since

3.5

Arguments

key

stringName in Storage

options

mixedScrip options as array or string

merge

boolWhether merge with existing (true) or replace (false)

Response

Documentinstance of $this to allow chaining

addStyleDeclaration

Adds a stylesheet declaration to the page

addStyleDeclaration( content,  type = 'text/css') : \Joomla\CMS\Document\Document
inherited deprecated
since

1.7.0

deprecated

4.3 will be removed in 6.0 Use WebAssetManager Example: $wa->addInlineStyle(...);

Arguments

content

stringStyle declarations

type

stringType of stylesheet (defaults to 'text/css')

Response

Documentinstance of $this to allow chaining

addStyleSheet

Adds a linked stylesheet to the page

addStyleSheet( url, mixed||string|int options = [], mixed||string|int attribs = []) : \Joomla\CMS\Document\Document
inherited deprecated
since

1.7.0

deprecated

4.3 will be removed in 6.0 Use WebAssetManager Example: $wa->registerAndUseStyle(...);

Arguments

url

stringURL to the linked style sheet

options

array<string|int, mixed>Array of options. Example: array('version' => 'auto', 'conditional' => 'lt IE 9', 'preload' => array('preload'))

attribs

array<string|int, mixed>Array of attributes. Example: array('id' => 'stylesheet', 'data-test' => 1)

Response

Documentinstance of $this to allow chaining

getBase

Return the base URI of the document.

getBase() : 
inherited
since

1.7.0

Response

string

getBuffer

Get the contents of the document buffer

getBuffer() : 
inherited
since

1.7.0

Response

mixed

getCharset

Returns the document charset encoding.

getCharset() : 
inherited
since

1.7.0

Response

string

getDescription

Return the description of the document.

getDescription() : 
inherited
since

1.7.0

Response

string

getDirection

Returns the document direction declaration.

getDirection() : 
inherited
since

1.7.0

Response

string

getGenerator

Returns the document generator

getGenerator() : 
inherited
since

1.7.0

Response

string

getInstance

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

getInstance( type = 'html', mixed||string|int attributes = []) : 
inherited static deprecated
since

1.7.0

deprecated

4.3 will be removed in 6.0 Use the \Joomla\CMS\Document\FactoryInterface instead Example: Factory::getApplication()->getDocument();

Arguments

type

stringThe document type to instantiate

attributes

array<string|int, mixed>Array of attributes

Response

staticThe document object.

getLanguage

Returns the document language.

getLanguage() : 
inherited
since

1.7.0

Response

string

getMediaVersion

Return the media version

getMediaVersion() : 
inherited
since

3.2

Response

string

getMetaData

Gets a meta tag.

getMetaData( name,  attribute = 'name') : 
inherited
since

1.7.0

Arguments

name

stringName of the meta HTML tag

attribute

stringAttribute to use in the meta HTML tag

Response

string

getMimeEncoding

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

getMimeEncoding() : 
inherited
since

1.7.0

Response

string

getModifiedDate

Returns the document modified date

getModifiedDate() : string|\Joomla\CMS\Date\Date
inherited
since

1.7.0

Response

string|Date

getPreloadManager

Return the preload manager

getPreloadManager() : \Joomla\CMS\Document\PreloadManagerInterface
inherited
since

4.0.0

Response

PreloadManagerInterface

getScriptOptions

Get script(s) options

getScriptOptions( key = null) : mixed||string|int
inherited
since

3.5

Arguments

key

stringName in Storage

Response

array<string|int, mixed>Options for given $key, or all script options

getTitle

Return the title of the document.

getTitle() : 
inherited
since

1.7.0

Response

string

getType

Returns the document type

getType() : 
inherited
since

1.7.0

Response

string

getWebAssetManager

Return WebAsset manager

getWebAssetManager() : \Joomla\CMS\WebAsset\WebAssetManager
inherited
since

4.0.0

Response

WebAssetManager

loadRenderer

Load a renderer

loadRenderer( type) : \Joomla\CMS\Document\RendererInterface
inherited
since

1.7.0

throws

RuntimeException

Arguments

type

stringThe renderer type

Response

RendererInterface

parse

Parses the document and prepares the buffers

parse(mixed||string|int params = []) : \Joomla\CMS\Document\Document
inherited
since

1.7.0

Arguments

params

array<string|int, mixed>The array of parameters

Response

Documentinstance of $this to allow chaining

preloadAssets

Generate the Link header for assets configured for preloading

preloadAssets() : 
inherited
since

4.0.0

Response

void

render

Render the document

render( cache = false, mixed||string|int params = []) : 
since

1.7.0

throws

Exception

todo

Make this cacheable

Arguments

cache

boolIf true, cache the output

params

array<string|int, mixed>Associative array of attributes

Response

stringThe rendered data

setBase

Sets the base URI of the document

setBase( base) : \Joomla\CMS\Document\Document
inherited
since

1.7.0

Arguments

base

stringThe base URI to be set

Response

Documentinstance of $this to allow chaining

setBuffer

Set the contents of the document buffer

setBuffer( content, mixed||string|int options = []) : \Joomla\CMS\Document\Document
inherited
since

1.7.0

Arguments

content

stringThe content to be set in the buffer.

options

array<string|int, mixed>Array of optional elements.

Response

Documentinstance of $this to allow chaining

setCharset

Sets the document charset

setCharset( type = 'utf-8') : \Joomla\CMS\Document\Document
inherited
since

1.7.0

Arguments

type

stringCharset encoding string

Response

Documentinstance of $this to allow chaining

setDescription

Sets the description of the document

setDescription( description) : \Joomla\CMS\Document\Document
inherited
since

1.7.0

Arguments

description

stringThe description to set

Response

Documentinstance of $this to allow chaining

setDirection

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

setDirection( dir = 'ltr') : \Joomla\CMS\Document\Document
inherited
since

1.7.0

Arguments

dir

stringThe language direction to be set

Response

Documentinstance of $this to allow chaining

setFactory

Set the factory instance

setFactory(\Joomla\CMS\Document\FactoryInterface factory) : \Joomla\CMS\Document\Document
inherited
since

4.0.0

Arguments

factory

FactoryInterfaceThe factory instance

Response

Document

setGenerator

Sets the document generator

setGenerator( generator) : \Joomla\CMS\Document\Document
inherited
since

1.7.0

Arguments

generator

stringThe generator to be set

Response

Documentinstance of $this to allow chaining

setLanguage

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

setLanguage( lang = 'en-gb') : \Joomla\CMS\Document\Document
inherited
since

1.7.0

Arguments

lang

stringThe language to be set

Response

Documentinstance of $this to allow chaining

setLineEnd

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

setLineEnd( style) : \Joomla\CMS\Document\Document
inherited
since

1.7.0

Arguments

style

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

Response

Documentinstance of $this to allow chaining

setMediaVersion

Set the assets version

setMediaVersion( mediaVersion) : \Joomla\CMS\Document\Document
inherited
since

3.2

Arguments

mediaVersion

stringMedia version to use

Response

Documentinstance of $this to allow chaining

setMetaData

Sets or alters a meta tag.

setMetaData( name,  content,  attribute = 'name') : \Joomla\CMS\Document\Document
inherited
since

1.7.0

Arguments

name

stringName of the meta HTML tag

content

mixedValue of the meta HTML tag as array or string

attribute

stringAttribute to use in the meta HTML tag

Response

Documentinstance of $this to allow chaining

setMimeEncoding

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

setMimeEncoding( type = 'text/html',  sync = true) : \Joomla\CMS\Document\Document
inherited

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

stringThe document type to be sent

sync

boolShould the type be synced with HTML?

Response

Documentinstance of $this to allow chaining

setModifiedDate

Sets the document modified date

setModifiedDate(string|\Joomla\CMS\Date\Date date) : \Joomla\CMS\Document\Document
inherited
since

1.7.0

throws

InvalidArgumentException

Arguments

date

string|DateThe date to be set

Response

Documentinstance of $this to allow chaining

setPreloadManager

Set the preload manager

setPreloadManager(\Joomla\CMS\Document\PreloadManagerInterface preloadManager) : \Joomla\CMS\Document\Document
inherited
since

4.0.0

Arguments

preloadManager

PreloadManagerInterfaceThe preload manager service

Response

Documentinstance of $this to allow chaining

setTab

Sets the string used to indent HTML

setTab( string) : \Joomla\CMS\Document\Document
inherited
since

1.7.0

Arguments

string

stringString used to indent ("\11", "\t", ' ', etc.).

Response

Documentinstance of $this to allow chaining

setTitle

Sets the title of the document

setTitle( title) : \Joomla\CMS\Document\Document
inherited
since

1.7.0

Arguments

title

stringThe title to be set

Response

Documentinstance of $this to allow chaining

setType

Set the document type

setType( type) : \Joomla\CMS\Document\Document
inherited
since

1.7.0

Arguments

type

stringType document is to set to

Response

Documentinstance of $this to allow chaining

setWebAssetManager

Set WebAsset manager

setWebAssetManager(\Joomla\CMS\WebAsset\WebAssetManager webAsset) : \Joomla\CMS\Document\Document
inherited
since

4.0.0

Arguments

webAsset

WebAssetManagerThe WebAsset instance

Response

Document

Properties

title

Document title

inherited
since

1.7.0

Type(s)

string

description

Document description

inherited
since

1.7.0

Type(s)

string

base

Document base URL

inherited
since

1.7.0

Type(s)

string

language

Contains the document language setting

inherited
since

1.7.0

Type(s)

string

direction

Contains the document direction setting

inherited
since

1.7.0

Type(s)

string

_generator

Document generator

inherited
since

1.7.0

Type(s)

string

_mdate

Document modified date

inherited
since

1.7.0

Type(s)

string|Date

_tab

Tab string

inherited
since

1.7.0

Type(s)

string

_lineEnd

Contains the line end string

inherited
since

1.7.0

Type(s)

string

_charset

Contains the character encoding string

inherited
since

1.7.0

Type(s)

string

_mime

Document mime type

inherited
since

1.7.0

Type(s)

string

_namespace

Document namespace

inherited
since

1.7.0

Type(s)

string

_profile

Document profile

inherited
since

1.7.0

Type(s)

string

_scripts

Array of linked scripts

inherited deprecated
since

1.7.0

deprecated

4.3 will be removed in 6.0 Use WebAssetManager

Type(s)

array<string|int, mixed>

_script

Array of scripts placed in the header

inherited deprecated
since

1.7.0

deprecated

4.3 will be removed in 6.0 Use WebAssetManager

Type(s)

array<string|int, mixed>

scriptOptions

Array of scripts options

inherited

Type(s)

array<string|int, mixed>

_styleSheets

Array of linked style sheets

inherited deprecated
since

1.7.0

deprecated

4.3 will be removed in 6.0 Use WebAssetManager

Type(s)

array<string|int, mixed>

_style

Array of included style declarations

inherited deprecated
since

1.7.0

deprecated

4.3 will be removed in 6.0 Use WebAssetManager

Type(s)

array<string|int, mixed>

_metaTags

Array of meta tags

inherited
since

1.7.0

Type(s)

array<string|int, mixed>

_engine

The rendering engine

inherited
since

1.7.0

Type(s)

object

_type

The document type

inherited
since

1.7.0

Type(s)

string

_buffer

Array of buffered output

inherited static
since

1.7.0

Type(s)

mixed

instances

Document instances container.

inherited static
since

1.7.3

Type(s)

array<string|int, mixed>

mediaVersion

Media version added to assets

inherited
since

3.2

Type(s)

string

factory

Factory for creating JDocument API objects

inherited
since

4.0.0

Type(s)

FactoryInterface

preloadManager

Preload manager

inherited
since

4.0.0

Type(s)

PreloadManagerInterface

preloadTypes

The supported preload types

inherited
since

4.0.0

Type(s)

array<string|int, mixed>

webAssetManager

Web Asset instance

inherited
since

4.0.0

Type(s)

WebAssetManager

syndicationURL

Syndication URL feed element

optional

since

1.7.0

Type(s)

string

image

Image feed element

optional

since

1.7.0

Type(s)

FeedImage

pubDate

Published date feed element

optional

since

1.7.0

Type(s)

string

lastBuildDate

Lastbuild date feed element

since

1.7.0

Type(s)

Date

editor

Editor feed element

optional

since

1.7.0

Type(s)

string

docs

Docs feed element

since

1.7.0

Type(s)

string

editorEmail

Editor email feed element

optional

since

1.7.0

Type(s)

string

webmaster

Webmaster email feed element

optional

since

1.7.0

Type(s)

string

category

Category feed element

optional

since

1.7.0

Type(s)

string

ttl

TTL feed attribute

optional

since

1.7.0

Type(s)

string

rating

Rating feed element

optional

since

1.7.0

Type(s)

string

skipHours

Skiphours feed element

optional

since

1.7.0

Type(s)

string

skipDays

Skipdays feed element

optional

since

1.7.0

Type(s)

string

items

The feed items collection

since

1.7.0

Type(s)

array<string|int, FeedItem>