JApplicationWebRouterBase

Extends \JApplicationWebRouter

Basic Web application router class for the Joomla Platform.

deprecated
since

12.2

deprecated

3.7.0 Use the joomla/router package via Composer instead

package

Joomla.Platform

Methods

__construct

Constructor.

__construct(\JApplicationWeb $app, \JInput $input = null) 
inherited
since

12.2

Arguments

$app

\JApplicationWebThe web application on whose behalf we are routing the request.

$input

\JInputAn optional input object from which to derive the route. If none is given than the input from the application object will be used.

addMap

Add a route map to the router. If the pattern already exists it will be overwritten.

addMap(string $pattern, string $controller) : \JApplicationWebRouter
since

12.2

Arguments

$pattern

stringThe route pattern to use for matching.

$controller

stringThe controller name to map to the given pattern.

Response

\JApplicationWebRouterThis object for method chaining.

addMaps

Add a route map to the router. If the pattern already exists it will be overwritten.

addMaps(array $maps) : \JApplicationWebRouter
since

12.2

Arguments

$maps

arrayA list of route maps to add to the router as $pattern => $controller.

Response

\JApplicationWebRouterThis object for method chaining.

execute

Find and execute the appropriate controller based on a given route.

execute(string $route) : mixed
inherited
since

12.2

throws

\InvalidArgumentException

\RuntimeException

Arguments

$route

stringThe route string for which to find and execute a controller.

Response

mixedThe return value of the controller executed

fetchController

Get a JController object for a given name.

fetchController(string $name) : \JController
inherited
since

12.2

throws

\RuntimeException

Arguments

$name

stringThe controller name (excluding prefix) for which to fetch and instance.

Response

\JController

parseRoute

Parse the given route and return the name of a controller mapped to the given route.

parseRoute(string $route) : string
inherited abstract
since

12.2

throws

\InvalidArgumentException

Arguments

$route

stringThe route string for which to find and execute a controller.

Response

stringThe controller name for the given route excluding prefix.

setControllerPrefix

Set the controller name prefix.

setControllerPrefix(string $prefix) : \JApplicationWebRouter
inherited
since

12.2

Arguments

$prefix

stringController class name prefix for creating controller objects by name.

Response

\JApplicationWebRouterThis object for method chaining.

setDefaultController

Set the default controller name.

setDefaultController(string $name) : \JApplicationWebRouter
inherited
since

12.2

Arguments

$name

stringThe default page controller name for an empty route.

Response

\JApplicationWebRouterThis object for method chaining.

Properties

maps

An array of rules, each rule being an associative array('regex'=> $regex, 'vars' => $vars, 'controller' => $controller) for routing the request.

Type(s)

array

app

The web application on whose behalf we are routing the request.

inherited

Type(s)

\JApplicationWeb

default

The default page controller name for an empty route.

inherited

Type(s)

string

controllerPrefix

Controller class name prefix for creating controller objects by name.

inherited

Type(s)

string

input

An input object from which to derive the route.

inherited

Type(s)

\JInput