FileLayout
Extends BaseLayoutBase class for rendering a display layout loaded from from a layout file
link | |
---|---|
since |
3.0 |
package |
Joomla CMS |
Methods
__construct
Method to instantiate the file-based layout.
__construct(string layoutId, string basePath = null, mixed options = null) : mixed
since |
3.0 |
---|
Arguments
- layoutId
string
Dot separated path to the layout file, relative to base path- basePath
string
Base path to use when loading layout files- options
mixed
Optional custom options to load. Registry or array format [@since 3.2]
Response
mixed
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
addIncludePath
Add one path to include in layout search. Proxy of addIncludePaths()
addIncludePath(string|string[] path) : self
since |
3.2 |
---|
Arguments
- path
string|string[]
The path to search for layouts
Response
self
addIncludePaths
Add one or more paths to include in layout search
addIncludePaths(string|string[] paths) : self
since |
3.2 |
---|
Arguments
- paths
string|string[]
The path or array of paths to search for layouts
Response
self
clearDebugMessages
Clear the debug messages array
clearDebugMessages() : self
since |
3.5 |
---|
Response
self
clearIncludePaths
Clear the include paths
clearIncludePaths() : 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 was 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
getDefaultIncludePaths
Get the default array of include paths
getDefaultIncludePaths() : array
since |
3.5 |
---|
Response
array
getIncludePaths
Get the active include paths
getIncludePaths() : array
since |
3.5 |
---|
Response
array
getLayoutId
Get the active layout id
getLayoutId() : string
since |
3.5 |
---|
Response
string
getOptions
Get the options
getOptions() : \Joomla\Registry\Registry
since |
3.2 |
---|
Response
\Joomla\Registry\Registry
Object with the options
getPath
Method to finds the full real file path, checking possible overrides
getPath() : string
since |
3.0 |
---|
Response
string
The full path to the layout file
getSuffixes
Get the active suffixes
getSuffixes() : array
since |
3.5 |
---|
Response
array
isDebugEnabled
Check if debug mode is enabled
isDebugEnabled() : bool
since |
3.5 |
---|
Response
bool
loadLanguageSuffixes
Load the automatically generated language suffixes.
loadLanguageSuffixes() : self
Example: array('es-ES', 'es', 'ltr')
since |
3.5 |
---|
Response
self
loadVersionSuffixes
Load the automatically generated version suffixes.
loadVersionSuffixes() : self
Example: array('j311', 'j31', 'j3')
since |
3.5 |
---|
Response
self
removeIncludePath
Remove one path from the layout search
removeIncludePath(string path) : self
since |
3.2 |
---|
Arguments
- path
string
The path to remove from the layout search
Response
self
removeIncludePaths
Remove one or more paths to exclude in layout search
removeIncludePaths(string paths) : self
since |
3.2 |
---|
Arguments
- paths
string
The path or array of paths to remove for the layout search
Response
self
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
since |
3.2 |
---|
Response
\Joomla\CMS\Layout\BaseLayout
Instance 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
string
Key for the data array- value
mixed
Value to assign to the key
Response
self
setClient
Function to initialise the application client
setClient(mixed client) : void
since |
3.2 |
---|
Arguments
- client
mixed
Frontend: 'site' or 0 | Backend: 'admin' or 1
setComponent
Method to change the component where search for layouts
setComponent(string option) : mixed
since |
3.2 |
---|
Arguments
- option
string
URL Option of the component. Example: com_content
Response
mixed
Component option string | null for none
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(bool debug) : self
since |
3.5 |
---|
Arguments
- debug
bool
Enable / Disable debug
Response
self
setIncludePaths
Set the include paths to search for layouts
setIncludePaths(array paths) : self
since |
3.5 |
---|
Arguments
- paths
array
Array with paths to search in
Response
self
setLayoutId
Set the active layout id
setLayoutId(string layoutId) : self
since |
3.5 |
---|
Arguments
- layoutId
string
Layout identifier
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.
setSuffixes
Set suffixes to search layouts
setSuffixes(mixed suffixes) : self
since |
3.5 |
---|
Arguments
- suffixes
mixed
String with a single suffix or 'auto' | 'none' or array of suffixes
Response
self
sublayout
Render a layout with the same include paths & options
sublayout(string layoutId, mixed displayData) : string
since |
3.2 |
---|
Arguments
- layoutId
string
The identifier for the sublayout to be searched in a subfolder with the name of the current layout- displayData
mixed
Data to be rendered
Response
string
The necessary HTML to display the layout
validComponent
Validate that the active component is valid
validComponent(string option = null) : bool
since |
3.2 |
---|
Arguments
- option
string
URL Option of the component. Example: com_content
Response
bool
Properties
fullPath
Full path to actual layout files, after possible template override check
options
Options object
since |
3.2 |
---|
Type(s)
\Joomla\Registry\Registry