class RouterView extends RouterBase

View-based component routing class

Properties

JApplicationCms $app Application object to use in the router from RouterBase
JMenu $menu Menu object to use in the router from RouterBase

Methods

__construct( JApplicationCms $app = null, JMenu $menu = null)

Class constructor.

array
preprocess( array $query)

Generic method to preprocess a URL

void
registerView( RouterViewConfiguration $view)

Register the views of a component

getViews()

Return an array of registered view objects

array
getPath( array $query)

Get the path of views from target view to root view including content items of a nestable view

getRules()

Get all currently attached rules

void
attachRules( RulesInterface[] $rules)

Add a number of router rules to the object

void
attachRule( RulesInterface $rule)

Attach a build rule

boolean
detachRule( RulesInterface $rule)

Remove a build rule

array
build( array $query)

Build method for URLs

array
parse( array $segments)

Parse method for URLs

string
getName()

Method to return the name of the router

Details

__construct( JApplicationCms $app = null, JMenu $menu = null)

Class constructor.

Parameters

JApplicationCms $app Application-object that the router should use
JMenu $menu Menu-object that the router should use

array preprocess( array $query)

Generic method to preprocess a URL

Parameters

array $query An associative array of URL arguments

Return Value

array The URL arguments to use to assemble the subsequent URL.

void registerView( RouterViewConfiguration $view)

Register the views of a component

Parameters

RouterViewConfiguration $view View configuration object

Return Value

void

RouterViewConfiguration[] getViews()

Return an array of registered view objects

Return Value

RouterViewConfiguration[] Array of registered view objects

array getPath( array $query)

Get the path of views from target view to root view including content items of a nestable view

Parameters

array $query Array of query elements

Return Value

array List of views including IDs of content items

RulesInterface[] getRules()

Get all currently attached rules

Return Value

RulesInterface[] All currently attached rules in an array

void attachRules( RulesInterface[] $rules)

Add a number of router rules to the object

Parameters

RulesInterface[] $rules Array of JComponentRouterRulesInterface objects

Return Value

void

void attachRule( RulesInterface $rule)

Attach a build rule

Parameters

RulesInterface $rule The function to be called.

Return Value

void

boolean detachRule( RulesInterface $rule)

Remove a build rule

Parameters

RulesInterface $rule The rule to be removed.

Return Value

boolean Was a rule removed?

array build( array $query)

Build method for URLs

Parameters

array $query &$query An array of URL arguments

Return Value

array The URL arguments to use to assemble the subsequent URL.

array parse( array $segments)

Parse method for URLs

Parameters

array $segments &$segments The segments of the URL to parse.

Return Value

array The URL attributes to be used by the application.

string getName()

Method to return the name of the router

Return Value

string Name of the router