class FileLayout extends BaseLayout

Base class for rendering a display layout loaded from from a layout file

Methods

setOptions( array|Registry $options = null)

Set the options

Registry
getOptions()

Get the options

resetOptions()

Function to empty all the options

string
escape( string $output)

Method to escape output.

array
getDebugMessages()

Get the debug messages array

string
render( array $displayData = array())

Method to render the layout.

string
renderDebugMessages()

Render the list of debug messages

addDebugMessage( string $message)

Add a debug message to the debug messages array

clearDebugMessages()

Clear the debug messages array

string
debug( mixed $data = array())

Render a layout with debug info

mixed
get( string $key, mixed $defaultValue = null)

Method to get the value from the data array

array
getData()

Get the data being rendered

boolean
isDebugEnabled()

Check if debug mode is enabled

set( string $key, mixed $value)

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

setData( array $data)

Set the the data passed the layout

setDebug( boolean $debug)

Change the debug mode

__construct( string $layoutId, string $basePath = null, mixed $options = null)

Method to instantiate the file-based layout.

addIncludePath( string $path)

Add one path to include in layout search. Proxy of addIncludePaths()

addIncludePaths( string $paths)

Add one or more paths to include in layout search

clearIncludePaths()

Clear the include paths

array
getIncludePaths()

Get the active include paths

string
getLayoutId()

Get the active layout id

array
getSuffixes()

Get the active suffixes

loadLanguageSuffixes()

Load the automatically generated language suffixes.

loadVersionSuffixes()

Load the automatically generated version suffixes.

removeIncludePath( string $path)

Remove one path from the layout search

removeIncludePaths( string $paths)

Remove one or more paths to exclude in layout search

mixed
setComponent( string $option)

Method to change the component where search for layouts

void
setClient( mixed $client)

Function to initialise the application client

setLayout( string $layoutId)

Change the layout

setLayoutId( string $layoutId)

Set the active layout id

array
getDefaultIncludePaths()

Get the default array of include paths

setIncludePaths( array $paths)

Set the include paths to search for layouts

setSuffixes( array $suffixes)

Set suffixes to search layouts

string
sublayout( string $layoutId, mixed $displayData)

Render a layout with the same include paths & options

Details

BaseLayout setOptions( array|Registry $options = null)

Set the options

Parameters

array|Registry $options Array / Registry object with the options to load

Return Value

BaseLayout Instance of $this to allow chaining.

Registry getOptions()

Get the options

Return Value

Registry Object with the options

BaseLayout resetOptions()

Function to empty all the options

Return Value

BaseLayout Instance of $this to allow chaining.

string escape( string $output)

Method to escape output.

Parameters

string $output The output to escape.

Return Value

string The escaped output.

array getDebugMessages()

Get the debug messages array

Return Value

array

string render( array $displayData = array())

Method to render the layout.

Parameters

array $displayData Array of properties available for use inside the layout file to build the displayed output

Return Value

string The rendered layout.

string renderDebugMessages()

Render the list of debug messages

Return Value

string Output text/HTML code

BaseLayout addDebugMessage( string $message)

Add a debug message to the debug messages array

Parameters

string $message Message to save

Return Value

BaseLayout

BaseLayout clearDebugMessages()

Clear the debug messages array

Return Value

BaseLayout

string debug( mixed $data = array())

Render a layout with debug info

Parameters

mixed $data Data passed to the layout

Return Value

string

mixed get( string $key, mixed $defaultValue = null)

Method to get the value from the data array

Parameters

string $key Key to search for in the data array
mixed $defaultValue Default value to return if the key is not set

Return Value

mixed Value from the data array | defaultValue if doesn't exist

array getData()

Get the data being rendered

Return Value

array

boolean isDebugEnabled()

Check if debug mode is enabled

Return Value

boolean

BaseLayout set( string $key, mixed $value)

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

Parameters

string $key Key for the data array
mixed $value Value to assign to the key

Return Value

BaseLayout

BaseLayout setData( array $data)

Set the the data passed the layout

Parameters

array $data Array with the data for the layout

Return Value

BaseLayout

BaseLayout setDebug( boolean $debug)

Change the debug mode

Parameters

boolean $debug Enable / Disable debug

Return Value

BaseLayout

__construct( string $layoutId, string $basePath = null, mixed $options = null)

Method to instantiate the file-based layout.

Parameters

string $layoutId Dot separated path to the layout file, relative to base path
string $basePath Base path to use when loading layout files
mixed $options Optional custom options to load. Registry or array format [@since 3.2]

FileLayout addIncludePath( string $path)

Add one path to include in layout search. Proxy of addIncludePaths()

Parameters

string $path The path to search for layouts

Return Value

FileLayout

FileLayout addIncludePaths( string $paths)

Add one or more paths to include in layout search

Parameters

string $paths The path or array of paths to search for layouts

Return Value

FileLayout

FileLayout clearIncludePaths()

Clear the include paths

Return Value

FileLayout

array getIncludePaths()

Get the active include paths

Return Value

array

string getLayoutId()

Get the active layout id

Return Value

string

array getSuffixes()

Get the active suffixes

Return Value

array

FileLayout loadLanguageSuffixes()

Load the automatically generated language suffixes.

Example: array('es-ES', 'es', 'ltr')

Return Value

FileLayout

FileLayout loadVersionSuffixes()

Load the automatically generated version suffixes.

Example: array('j311', 'j31', 'j3')

Return Value

FileLayout

FileLayout removeIncludePath( string $path)

Remove one path from the layout search

Parameters

string $path The path to remove from the layout search

Return Value

FileLayout

FileLayout removeIncludePaths( string $paths)

Remove one or more paths to exclude in layout search

Parameters

string $paths The path or array of paths to remove for the layout search

Return Value

FileLayout

mixed setComponent( string $option)

Method to change the component where search for layouts

Parameters

string $option URL Option of the component. Example: com_content

Return Value

mixed Component option string | null for none

void setClient( mixed $client)

Function to initialise the application client

Parameters

mixed $client Frontend: 'site' or 0 | Backend: 'admin' or 1

Return Value

void

FileLayout setLayout( string $layoutId)

Change the layout

Parameters

string $layoutId Layout to render

Return Value

FileLayout

FileLayout setLayoutId( string $layoutId)

Set the active layout id

Parameters

string $layoutId Layout identifier

Return Value

FileLayout

array getDefaultIncludePaths()

Get the default array of include paths

Return Value

array

FileLayout setIncludePaths( array $paths)

Set the include paths to search for layouts

Parameters

array $paths Array with paths to search in

Return Value

FileLayout

FileLayout setSuffixes( array $suffixes)

Set suffixes to search layouts

Parameters

array $suffixes String with a single suffix or 'auto' | 'none' or array of suffixes

Return Value

FileLayout

string sublayout( string $layoutId, mixed $displayData)

Render a layout with the same include paths & options

Parameters

string $layoutId The identifier for the sublayout to be searched in a subfolder with the name of the current layout
mixed $displayData Data to be rendered

Return Value

string The necessary HTML to display the layout