BaseLayout

Implements LayoutInterface

Base class for rendering a display layout

link
since

3.0

package

Application

Methods

addDebugMessage

Add a debug message to the debug messages array

addDebugMessage(string message) : self
since

3.2

Arguments

message

stringMessage to save

Response

self

clearDebugMessages

Clear the debug messages array

clearDebugMessages() : self
since

3.5

Response

self

debug

Render a layout with debug info

debug(mixed data = array()) : string
since

3.5

Arguments

data

mixedData passed to the layout

Response

string

escape

Method to escape output.

escape(string output) : string
note

the ENT_COMPAT flag was replaced by ENT_QUOTES in Joomla 4.0 to also escape single quotes

since

3.0

Arguments

output

stringThe output to escape.

Response

stringThe escaped output.

get

Method to get the value from the data array

get(string key, mixed defaultValue = null) : mixed
since

3.5

Arguments

key

stringKey to search for in the data array

defaultValue

mixedDefault value to return if the key is not set

Response

mixedValue from the data array | defaultValue if doesn't exist

getData

Get the data being rendered

getData() : array
since

3.5

Response

array

getDebugMessages

Get the debug messages array

getDebugMessages() : array
since

3.2

Response

array

getOptions

Get the options

getOptions() : \Joomla\Registry\Registry
since

3.2

Response

\Joomla\Registry\RegistryObject with the options

isDebugEnabled

Check if debug mode is enabled

isDebugEnabled() : bool
since

3.5

Response

bool

render

Method to render the layout.

render(array displayData) : string
since

3.0

Arguments

displayData

arrayArray of properties available for use inside the layout file to build the displayed output

Response

stringThe necessary HTML to display the layout

renderDebugMessages

Render the list of debug messages

renderDebugMessages() : string
since

3.2

Response

stringOutput text/HTML code

resetOptions

Function to empty all the options

resetOptions() : \Joomla\CMS\Layout\BaseLayout
since

3.2

Response

\Joomla\CMS\Layout\BaseLayoutInstance of $this to allow chaining.

set

Method to set a value in the data array. Example: $layout->set('items', $items);

set(string key, mixed value) : self
since

3.5

Arguments

key

stringKey for the data array

value

mixedValue to assign to the key

Response

self

setData

Set the the data passed the layout

setData(array data) : self
since

3.5

Arguments

data

arrayArray with the data for the layout

Response

self

setDebug

Change the debug mode

setDebug(bool debug) : self
since

3.5

Arguments

debug

boolEnable / Disable debug

Response

self

setOptions

Set the options

setOptions(array|\Joomla\Registry\Registry options = null) : \Joomla\CMS\Layout\BaseLayout
since

3.2

Arguments

options

array|\Joomla\Registry\RegistryArray / Registry object with the options to load

Response

\Joomla\CMS\Layout\BaseLayoutInstance of $this to allow chaining.

Properties

options

Options object

since

3.2

Type(s)

\Joomla\Registry\Registry

data

Data for the layout

since

3.5

Type(s)

array

debugMessages

Debug information messages

since

3.2

Type(s)

array