FileLayout
Extends BaseLayoutBase class for rendering a display layout loaded from a layout file
| link | |
|---|---|
| since |
3.0 |
| package |
Joomla CMS |
Methods
__construct
Method to instantiate the file-based layout.
__construct( layoutId, basePath = null, options = null) :
| since |
3.0 |
|---|
Arguments
- layoutId
stringDot separated path to the layout file, relative to base path- basePath
stringBase path to use when loading layout files- options
mixedOptional custom options to load. Registry or array format [@since 3.2]
Response
mixed
addDebugMessage
Add a debug message to the debug messages array
addDebugMessage( message) :
| since |
3.2 |
|---|
Arguments
- message
stringMessage to save
Response
self
addIncludePath
Add one path to include in layout search. Proxy of addIncludePaths()
addIncludePath(string|string[] path) :
| since |
3.2 |
|---|
Arguments
- path
string|array<string|int, string>The path to search for layouts
Response
self
addIncludePaths
Add one or more paths to include in layout search
addIncludePaths(string|string[] paths) :
| since |
3.2 |
|---|
Arguments
- paths
string|array<string|int, string>The path or array of paths to search for layouts
Response
self
clearDebugMessages
Clear the debug messages array
clearDebugMessages() :
| since |
3.5 |
|---|
Response
self
clearIncludePaths
Clear the include paths
clearIncludePaths() :
| since |
3.5 |
|---|
Response
self
debug
Render a layout with debug info
debug( data = []) :
| since |
3.5 |
|---|
Arguments
- data
mixedData passed to the layout
Response
string
escape
Method to escape output.
escape( output) :
| 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( key, defaultValue = null) :
| 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() : mixed||string|int
| since |
3.5 |
|---|
Response
array<string|int, mixed>
getDebugMessages
Get the debug messages array
getDebugMessages() : mixed||string|int
| since |
3.2 |
|---|
Response
array<string|int, mixed>
getDefaultIncludePaths
Get the default array of include paths
getDefaultIncludePaths() : mixed||string|int
| since |
3.5 |
|---|
Response
array<string|int, mixed>
getIncludePaths
Get the active include paths
getIncludePaths() : mixed||string|int
| since |
3.5 |
|---|
Response
array<string|int, mixed>
getLayoutId
Get the active layout id
getLayoutId() :
| since |
3.5 |
|---|
Response
string
getOptions
Get the options
getOptions() : \Joomla\Registry\Registry
| since |
3.2 |
|---|
Response
RegistryObject with the options
getPath
Method to finds the full real file path, checking possible overrides
getPath() :
| since |
3.0 |
|---|
Response
stringThe full path to the layout file
getSuffixes
Get the active suffixes
getSuffixes() : mixed||string|int
| since |
3.5 |
|---|
Response
array<string|int, mixed>
isDebugEnabled
Check if debug mode is enabled
isDebugEnabled() :
| since |
3.5 |
|---|
Response
bool
loadLanguageSuffixes
Load the automatically generated language suffixes.
loadLanguageSuffixes() :
Example: array('es-ES', 'es', 'ltr')
| since |
3.5 |
|---|
Response
self
loadVersionSuffixes
Load the automatically generated version suffixes.
loadVersionSuffixes() :
Example: array('j311', 'j31', 'j3')
| since |
3.5 |
|---|
Response
self
removeIncludePath
Remove one path from the layout search
removeIncludePath( path) :
| since |
3.2 |
|---|
Arguments
- path
stringThe path to remove from the layout search
Response
self
removeIncludePaths
Remove one or more paths to exclude in layout search
removeIncludePaths( paths) :
| since |
3.2 |
|---|
Arguments
- paths
stringThe path or array of paths to remove for the layout search
Response
self
render
Method to render the layout.
render(mixed||string|int displayData = []) :
| since |
3.0 |
|---|
Arguments
- displayData
array<string|int, mixed>Array 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() :
| since |
3.2 |
|---|
Response
stringOutput 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( key, value) :
| since |
3.5 |
|---|
Arguments
- key
stringKey for the data array- value
mixedValue to assign to the key
Response
self
setClient
Function to initialise the application client
setClient( client) :
| since |
3.2 |
|---|
Arguments
- client
mixedFrontend: 'site' or 0 | Backend: 'admin' or 1
Response
void
setComponent
Change the component for the search paths for layouts
setComponent( option) :
| since |
3.2 |
|---|
Arguments
- option
stringURL Option of the component. Example: com_content
Response
void
setData
Set the data passed the layout
setData(mixed||string|int data) :
| since |
3.5 |
|---|
Arguments
- data
array<string|int, mixed>Array with the data for the layout
Response
self
setDebug
Change the debug mode
setDebug( debug) :
| since |
3.5 |
|---|
Arguments
- debug
boolEnable / Disable debug
Response
self
setIncludePaths
Set the include paths to search for layouts
setIncludePaths(mixed||string|int paths) :
| since |
3.5 |
|---|
Arguments
- paths
array<string|int, mixed>Array with paths to search in
Response
self
setLayoutId
Set the active layout id
setLayoutId( layoutId) :
| since |
3.5 |
|---|
Arguments
- layoutId
stringLayout identifier
Response
self
setOptions
Set the options
setOptions(array|\Joomla\Registry\Registry options = null) : \Joomla\CMS\Layout\BaseLayout
| since |
3.2 |
|---|
Arguments
- options
array<string|int, mixed>|RegistryArray / Registry object with the options to load
Response
BaseLayoutInstance of $this to allow chaining.
setSuffixes
Set suffixes to search layouts
setSuffixes(mixed||string|int suffixes) :
| since |
3.5 |
|---|
Arguments
- suffixes
array<string|int, mixed>Array of suffixes to utilise
Response
self
sublayout
Render a layout with the same include paths & options
sublayout( layoutId, displayData) :
| since |
3.2 |
|---|
Arguments
- layoutId
stringThe identifier for the sublayout to be searched in a subfolder with the name of the current layout- displayData
mixedData to be rendered
Response
stringThe necessary HTML to display the layout
validComponent
Validate that the active component is valid
validComponent( option = null) :
| since |
3.2 |
|---|
Arguments
- option
stringURL Option of the component. Example: com_content
Response
bool
Properties
options
Options object
| since |
3.2 |
|---|
Type(s)
Registry
data
Data for the layout
| since |
3.5 |
|---|
Type(s)
array<string|int, mixed>
debugMessages
Debug information messages
| since |
3.2 |
|---|
Type(s)
array<string|int, mixed>
cache
Cached layout paths
| since |
3.5 |
|---|
Type(s)
array<string|int, mixed>
layoutId
Dot separated path to the layout file, relative to base path
| since |
3.0 |
|---|
Type(s)
string
basePath
Base path to use when loading layout files
| since |
3.0 |
|---|
Type(s)
string
fullPath
Full path to actual layout files, after possible template override check
| since |
3.0.3 |
|---|
Type(s)
string
includePaths
Paths to search for layouts
| since |
3.2 |
|---|
Type(s)
array<string|int, mixed>