JComponentRouterView

Extends \JComponentRouterBase

View-based component routing class

abstract
since

3.5

package

Joomla.Libraries

Methods

__construct

Class constructor.

__construct(\JApplicationCms $app = null, \JMenu $menu = null) 
inherited
since

3.4

Arguments

$app

\JApplicationCmsApplication-object that the router should use

$menu

\JMenuMenu-object that the router should use

attachRule

Attach a build rule

attachRule(\JComponentRouterRulesInterface $rule) : void
since

3.5

Arguments

$rule

\JComponentRouterRulesInterfaceThe function to be called.

attachRules

Add a number of router rules to the object

attachRules(array<mixed,\JComponentRouterRulesInterface> $rules) : void
since

3.5

Arguments

$rules

array<mixed,\JComponentRouterRulesInterface>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(\JComponentRouterRulesInterface $rule) : boolean
since

3.5

Arguments

$rule

\JComponentRouterRulesInterfaceThe 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,\JComponentRouterRulesInterface>
since

3.5

Response

array<mixed,\JComponentRouterRulesInterface>All currently attached rules in an array

getViews

Return an array of registered view objects

getViews() : array<mixed,\JComponentRouterViewconfiguration>
since

3.5

Response

array<mixed,\JComponentRouterViewconfiguration>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(\JComponentRouterViewconfiguration $view) : void
since

3.5

Arguments

$view

\JComponentRouterViewconfigurationView configuration object

Properties

name

Name of the router of the component

Type(s)

string

rules

Array of rules

Type(s)

array<mixed,\JComponentRouterRulesInterface>

views

Views of the component

Type(s)

array<mixed,\JComponentRouterViewconfiguration>

app

Application object to use in the router

inherited

menu

Menu object to use in the router

inherited

Type(s)

\JMenu