JDocumentRaw
Extends \JDocumentDocumentRAW class, provides an easy interface to parse and display raw output
This class allows for simple but smart objects with get and set methods and an internal error handler.
package |
Joomla.Platform |
---|---|
subpackage |
Document |
since |
11.1 |
Methods
__construct
Class constructor, overridden in descendant classes.
__construct(mixed $properties = null)
since |
11.1 |
---|
Arguments
- $properties
mixed
Either and associative array or another object to set the initial properties of the object.
__toString
Magic method to convert the object to a string gracefully.
__toString() : string
since |
11.1 |
---|---|
deprecated |
12.3 Classes should provide their own __toString() implementation. |
Response
string
The classname.
_getLineEnd
Returns the lineEnd
_getLineEnd() : string
since |
11.1 |
---|
Response
string
_getTab
Returns a string containing the unit for indenting HTML
_getTab() : string
since |
11.1 |
---|
Response
string
addScript
Adds a linked script to the page
addScript(string $url, string $type = "text/javascript", boolean $defer = false, boolean $async = false) : \JDocument
since |
11.1 |
---|
Arguments
- $url
string
URL to the linked script- $type
string
Type of script. Defaults to 'text/javascript'- $defer
boolean
Adds the defer attribute.- $async
boolean
Adds the async attribute.
Response
\JDocument
instance of $this to allow chaining
addScriptDeclaration
Adds a script to the page
addScriptDeclaration(string $content, string $type = 'text/javascript') : \JDocument
since |
11.1 |
---|
Arguments
- $content
string
Script- $type
string
Scripting mime (defaults to 'text/javascript')
Response
\JDocument
instance of $this to allow chaining
addStyleDeclaration
Adds a stylesheet declaration to the page
addStyleDeclaration(string $content, string $type = 'text/css') : \JDocument
since |
11.1 |
---|
Arguments
- $content
string
Style declarations- $type
string
Type of stylesheet (defaults to 'text/css')
Response
\JDocument
instance of $this to allow chaining
addStyleSheet
Adds a linked stylesheet to the page
addStyleSheet(string $url, string $type = 'text/css', string $media = null, array $attribs = array()) : \JDocument
since |
11.1 |
---|
Arguments
- $url
string
URL to the linked style sheet- $type
string
Mime encoding type- $media
string
Media type that this stylesheet applies to- $attribs
array
Array of attributes
Response
\JDocument
instance of $this to allow chaining
def
Sets a default value if not alreay assigned
def(string $property, mixed $default = null) : mixed
since |
11.1 |
---|
Arguments
- $property
string
The name of the property.- $default
mixed
The default value.
Response
mixed
get
Returns a property of the object or the default value if the property is not set.
get(string $property, mixed $default = null) : mixed
since |
11.1 |
---|---|
see | \JObject::getProperties() |
Arguments
- $property
string
The name of the property.- $default
mixed
The default value.
Response
mixed
The value of the property.
getBase
Return the base URI of the document.
getBase() : string
since |
11.1 |
---|
Response
string
getBuffer
Get the contents of the document buffer
getBuffer() : \The
since |
11.1 |
---|
Response
\The
contents of the document buffer
getCharset
Returns the document charset encoding.
getCharset() : string
since |
11.1 |
---|
Response
string
getDescription
Return the title of the page.
getDescription() : string
since |
11.1 |
---|
Response
string
getDirection
Returns the document direction declaration.
getDirection() : string
since |
11.1 |
---|
Response
string
getError
Get the most recent error message.
getError(integer $i = null, boolean $toString = true) : string
since |
11.1 |
---|---|
see | \JError |
deprecated |
12.3 JError has been deprecated |
Arguments
- $i
integer
Option error index.- $toString
boolean
Indicates if JError objects should return their error message.
Response
string
Error message
getErrors
Return all errors, if any.
getErrors() : array
since |
11.1 |
---|---|
see | \JError |
deprecated |
12.3 JError has been deprecated |
Response
array
Array of error messages or JErrors.
getGenerator
Returns the document generator
getGenerator() : string
since |
11.1 |
---|
Response
string
getInstance
Returns the global JDocument object, only creating it if it doesn't already exist.
getInstance(string $type = 'html', array $attributes = array()) : object
since |
11.1 |
---|
Arguments
- $type
string
The document type to instantiate- $attributes
array
Array of attributes
Response
object
The document object.
getLanguage
Returns the document language.
getLanguage() : string
since |
11.1 |
---|
Response
string
getLink
Returns the document base url
getLink() : string
since |
11.1 |
---|
Response
string
getMetaData
Gets a meta tag.
getMetaData(string $name, boolean $httpEquiv = false) : string
since |
11.1 |
---|
Arguments
- $name
string
Value of name or http-equiv tag- $httpEquiv
boolean
META type "http-equiv" defaults to null
Response
string
getMimeEncoding
Return the document MIME encoding that is sent to the browser.
getMimeEncoding() : string
since |
11.1 |
---|
Response
string
getModifiedDate
Returns the document modified date
getModifiedDate() : string
since |
11.1 |
---|
Response
string
getProperties
Returns an associative array of object properties.
getProperties(boolean $public = true) : array
since |
11.1 |
---|---|
see | \JObject::get() |
Arguments
- $public
boolean
If true, returns only the public properties.
Response
array
getTitle
Return the title of the document.
getTitle() : string
since |
11.1 |
---|
Response
string
getType
Returns the document type
getType() : string
since |
11.1 |
---|
Response
string
loadRenderer
Load a renderer
loadRenderer(string $type) : \JDocumentRenderer
since |
11.1 |
---|
Arguments
- $type
string
The renderer type
Response
\JDocumentRenderer
Object or null if class does not exist
parse
Parses the document and prepares the buffers
parse(array $params = array()) : \JDocument
since |
11.1 |
---|
Arguments
- $params
array
The array of parameters
Response
\JDocument
instance of $this to allow chaining
render
Outputs the document
render(boolean $cache = false, array $params = array()) : \The
since |
11.1 |
---|
Arguments
- $cache
boolean
If true, cache the output- $params
array
Associative array of attributes
Response
\The
rendered data
set
Modifies a property of the object, creating it if it does not already exist.
set(string $property, mixed $value = null) : mixed
since |
11.1 |
---|
Arguments
- $property
string
The name of the property.- $value
mixed
The value of the property to set.
Response
mixed
Previous value of the property.
setBase
Sets the base URI of the document
setBase(string $base) : \JDocument
since |
11.1 |
---|
Arguments
- $base
string
The base URI to be set
Response
\JDocument
instance of $this to allow chaining
setBuffer
Set the contents of the document buffer
setBuffer(string $content, array $options = array()) : \JDocument
since |
11.1 |
---|
Arguments
- $content
string
The content to be set in the buffer.- $options
array
Array of optional elements.
Response
\JDocument
instance of $this to allow chaining
setCharset
Sets the document charset
setCharset(string $type = 'utf-8') : \JDocument
since |
11.1 |
---|
Arguments
- $type
string
Charset encoding string
Response
\JDocument
instance of $this to allow chaining
setDescription
Sets the description of the document
setDescription(string $description) : \JDocument
since |
11.1 |
---|
Arguments
- $description
string
The description to set
Response
\JDocument
instance of $this to allow chaining
setDirection
Sets the global document direction declaration. Default is left-to-right (ltr).
setDirection(string $dir = "ltr") : \JDocument
since |
11.1 |
---|
Arguments
- $dir
string
The language direction to be set
Response
\JDocument
instance of $this to allow chaining
setError
Add an error message.
setError(string $error) : void
since |
11.1 |
---|---|
see | \JError |
deprecated |
12.3 JError has been deprecated |
Arguments
- $error
string
Error message.
setGenerator
Sets the document generator
setGenerator(string $generator) : \JDocument
since |
11.1 |
---|
Arguments
- $generator
string
The generator to be set
Response
\JDocument
instance of $this to allow chaining
setLanguage
Sets the global document language declaration. Default is English (en-gb).
setLanguage(string $lang = "en-gb") : \JDocument
since |
11.1 |
---|
Arguments
- $lang
string
The language to be set
Response
\JDocument
instance of $this to allow chaining
setLineEnd
Sets the line end style to Windows, Mac, Unix or a custom string.
setLineEnd(string $style) : \JDocument
since |
11.1 |
---|
Arguments
- $style
string
"win", "mac", "unix" or custom string.
Response
\JDocument
instance of $this to allow chaining
setLink
Sets the document link
setLink(string $url) : \JDocument
setMetaData
Sets or alters a meta tag.
setMetaData(string $name, string $content, boolean $http_equiv = false, boolean $sync = true) : \JDocument
since |
11.1 |
---|
Arguments
- $name
string
Value of name or http-equiv tag- $content
string
Value of the content tag- $http_equiv
boolean
META type "http-equiv" defaults to null- $sync
boolean
Should http-equiv="content-type" by synced with HTTP-header?
Response
\JDocument
instance of $this to allow chaining
setMimeEncoding
Sets the document MIME encoding that is sent to the browser.
setMimeEncoding(string $type = 'text/html', boolean $sync = true) : \JDocument
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.
since |
11.1 |
---|---|
link |
Arguments
- $type
string
The document type to be sent- $sync
boolean
Should the type be synced with HTML?
Response
\JDocument
instance of $this to allow chaining
setModifiedDate
Sets the document modified date
setModifiedDate(string $date) : \JDocument
since |
11.1 |
---|
Arguments
- $date
string
The date to be set
Response
\JDocument
instance of $this to allow chaining
setProperties
Set the object properties based on a named array/hash.
setProperties(mixed $properties) : boolean
since |
11.1 |
---|---|
see | \JObject::set() |
Arguments
- $properties
mixed
Either an associative array or another object.
Response
boolean
setTab
Sets the string used to indent HTML
setTab(string $string) : \JDocument
since |
11.1 |
---|
Arguments
- $string
string
String used to indent ("\11", "\t", ' ', etc.).
Response
\JDocument
instance of $this to allow chaining
setTitle
Sets the title of the document
setTitle(string $title) : \JDocument
since |
11.1 |
---|
Arguments
- $title
string
The title to be set
Response
\JDocument
instance of $this to allow chaining
setType
Set the document type
setType(string $type) : \JDocument
since |
11.1 |
---|
Arguments
- $type
string
Type document is to set to
Response
\JDocument
instance of $this to allow chaining
toString
Converts the object to a string (the class name).
toString() : string
Properties
title
Document title
since |
11.1 |
---|
Type(s)
string
description
Document description
since |
11.1 |
---|
Type(s)
string
link
Document full URL
since |
11.1 |
---|
Type(s)
string
base
Document base URL
since |
11.1 |
---|
Type(s)
string
language
Contains the document language setting
since |
11.1 |
---|
Type(s)
string
direction
Contains the document direction setting
since |
11.1 |
---|
Type(s)
string
_generator
Document generator
Type(s)
string
_mdate
Document modified date
since |
11.1 |
---|
Type(s)
string
_tab
Tab string
since |
11.1 |
---|
Type(s)
string
_lineEnd
Contains the line end string
since |
11.1 |
---|
Type(s)
string
_charset
Contains the character encoding string
since |
11.1 |
---|
Type(s)
string
_mime
Document mime type
since |
11.1 |
---|
Type(s)
string
_namespace
Document namespace
since |
11.1 |
---|
Type(s)
string
_profile
Document profile
since |
11.1 |
---|
Type(s)
string
_scripts
Array of linked scripts
since |
11.1 |
---|
Type(s)
array
_script
Array of scripts placed in the header
since |
11.1 |
---|
Type(s)
array
_styleSheets
Array of linked style sheets
since |
11.1 |
---|
Type(s)
array
_style
Array of included style declarations
since |
11.1 |
---|
Type(s)
array
_metaTags
Array of meta tags
since |
11.1 |
---|
Type(s)
array
_engine
The rendering engine
since |
11.1 |
---|
Type(s)
object
_type
The document type
since |
11.1 |
---|
Type(s)
string
_buffer
Array of buffered output
since |
11.1 |
---|
Type(s)
mixed
instances
JDocument instances container.
since |
11.3 |
---|
Type(s)
array
_errors
An array of error messages or Exception objects.