class BaseLayout implements LayoutInterface

Base class for rendering a display layout

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)

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

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)

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