RouterView

Extends RouterBase

View-based component routing class

abstract
since

3.5

package

Application

Methods

__construct

Class constructor.

__construct(\Joomla\CMS\Application\CMSApplication app = null, \Joomla\CMS\Menu\AbstractMenu menu = null) : mixed
inherited
since

3.4

Arguments

app

\Joomla\CMS\Application\CMSApplicationApplication-object that the router should use

menu

\Joomla\CMS\Menu\AbstractMenuMenu-object that the router should use

Response

mixed

attachRule

Attach a build rule

attachRule(\Joomla\CMS\Component\Router\Rules\RulesInterface rule) : void
since

3.5

Arguments

rule

\Joomla\CMS\Component\Router\Rules\RulesInterfaceThe function to be called.

attachRules

Add a number of router rules to the object

attachRules(\Joomla\CMS\Component\Router\Rules\RulesInterface[] rules) : void
since

3.5

Arguments

rules

\Joomla\CMS\Component\Router\Rules\RulesInterface[]Array of JComponentRouterRulesInterface objects

build

Build method for URLs

build(array &query) : array
since

3.5

Arguments

query

arrayArray of query elements

Response

arrayArray of URL segments

detachRule

Remove a build rule

detachRule(\Joomla\CMS\Component\Router\Rules\RulesInterface rule) : bool
since

3.5

Arguments

rule

\Joomla\CMS\Component\Router\Rules\RulesInterfaceThe rule to be removed.

Response

boolWas a rule removed?

getName

Method to return the name of the router

getName() : string
since

3.5

Response

stringName of the router

getPath

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

getPath(array query) : array
since

3.5

Arguments

query

arrayArray of query elements

Response

arrayList of views including IDs of content items

getRules

Get all currently attached rules

getRules() : \Joomla\CMS\Component\Router\Rules\RulesInterface[]
since

3.5

Response

\Joomla\CMS\Component\Router\Rules\RulesInterface[]All currently attached rules in an array

getViews

Return an array of registered view objects

getViews() : \Joomla\CMS\Component\Router\RouterViewConfiguration[]
since

3.5

Response

\Joomla\CMS\Component\Router\RouterViewConfiguration[]Array of registered view objects

parse

Parse method for URLs

parse(array &segments) : array
since

3.5

Arguments

segments

arrayArray of URL string-segments

Response

arrayAssociative array of query values

preprocess

Generic method to preprocess a URL

preprocess(array query) : array
inherited
since

3.3

Arguments

query

arrayAn associative array of URL arguments

Response

arrayThe URL arguments to use to assemble the subsequent URL.

registerView

Register the views of a component

registerView(\Joomla\CMS\Component\Router\RouterViewConfiguration view) : void
since

3.5

Arguments

view

\Joomla\CMS\Component\Router\RouterViewConfigurationView configuration object

Properties

name

Name of the router of the component

since

3.5

Type(s)

string

rules

Array of rules

since

3.5

Type(s)

RulesInterface[]

views

Views of the component

since

3.5

Type(s)

RouterViewConfiguration[]

app

Application object to use in the router

inherited
since

3.4

Type(s)

CMSApplication

menu

Menu object to use in the router

inherited
since

3.4

Type(s)

AbstractMenu