RouterView

Extends \Joomla\CMS\Component\Router\RouterBase

View-based component routing class

abstract
since

3.5

Methods

__construct

Class constructor.

__construct(\Joomla\CMS\Application\CMSApplication $app = null, \Joomla\CMS\Menu\AbstractMenu $menu = null) 
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

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(array<mixed,\Joomla\CMS\Component\Router\Rules\RulesInterface> $rules) : void
since

3.5

Arguments

$rules

array<mixed,\Joomla\CMS\Component\Router\Rules\RulesInterface>Array of JComponentRouterRulesInterface objects

build

Build method for URLs

build( &$query) : array
since

3.5

Arguments

$query

Response

arrayArray of URL segments

detachRule

Remove a build rule

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

3.5

Arguments

$rule

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

Response

booleanWas 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() : array<mixed,\Joomla\CMS\Component\Router\Rules\RulesInterface>
since

3.5

Response

array<mixed,\Joomla\CMS\Component\Router\Rules\RulesInterface>All currently attached rules in an array

getViews

Return an array of registered view objects

getViews() : array<mixed,\Joomla\CMS\Component\Router\RouterViewConfiguration>
since

3.5

Response

array<mixed,\Joomla\CMS\Component\Router\RouterViewConfiguration>Array of registered view objects

parse

Parse method for URLs

parse( &$segments) : array
since

3.5

Arguments

$segments

Response

arrayAssociative array of query values

preprocess

Generic method to preprocess a URL

preprocess(array $query) : array
inherited

For example it can add the Itemid or set a language parameter. This method is executed on each URL, regardless of SEF mode switched on or not.

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)

array<mixed,\Joomla\CMS\Component\Router\Rules\RulesInterface>

views

Views of the component

app

Application object to use in the router

inherited

menu

Menu object to use in the router

inherited
since

3.4

Type(s)

\Joomla\CMS\Menu\AbstractMenu