BaseLayout
Implements \Joomla\CMS\Layout\LayoutInterfaceBase class for rendering a display layout
link |
https://docs.joomla.org/Special:MyLanguage/Sharing_layouts_across_views_or_extensions_with_JLayout |
---|---|
since |
3.0 |
Methods
addDebugMessage
Add a debug message to the debug messages array
addDebugMessage(string $message) : self
since |
3.2 |
---|
Arguments
- $message
string
Message 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
mixed
Data passed to the layout
Response
string
escape
Method to escape output.
escape(string $output) : string
note |
the ENT_COMPAT flag will be replaced by ENT_QUOTES in Joomla 4.0 to also escape single quotes |
---|---|
since |
3.0 |
Arguments
- $output
string
The output to escape.
Response
string
The escaped output.
get
Method to get the value from the data array
get(string $key, mixed $defaultValue = null) : mixed
since |
3.5 |
---|
Arguments
- $key
string
Key to search for in the data array- $defaultValue
mixed
Default value to return if the key is not set
Response
mixed
Value 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
isDebugEnabled
Check if debug mode is enabled
isDebugEnabled() : boolean
since |
3.5 |
---|
Response
boolean
render
Method to render the layout.
render(array $displayData) : string
since |
3.0 |
---|
Arguments
- $displayData
array
Array of properties available for use inside the layout file to build the displayed output
Response
string
The necessary HTML to display the layout
renderDebugMessages
Render the list of debug messages
renderDebugMessages() : string
since |
3.2 |
---|
Response
string
Output text/HTML code
resetOptions
Function to empty all the options
resetOptions() : \Joomla\CMS\Layout\BaseLayout
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
string
Key for the data array- $value
mixed
Value to assign to the key
Response
self
setData
Set the the data passed the layout
setData(array $data) : self
since |
3.5 |
---|
Arguments
- $data
array
Array with the data for the layout
Response
self
setDebug
Change the debug mode
setDebug(boolean $debug) : self
since |
3.5 |
---|
Arguments
- $debug
boolean
Enable / 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\Registry
Array / Registry object with the options to load
Response
\Joomla\CMS\Layout\BaseLayout
Instance of $this to allow chaining.
Properties
data
Data for the layout
since |
3.5 |
---|
Type(s)
array
debugMessages
Debug information messages
since |
3.2 |
---|
Type(s)
array