class JApplicationWebRouterBase extends JApplicationWebRouter

Basic Web application router class for the Joomla Platform.

Methods

__construct( JApplicationWeb $app, JInput $input = null)

Constructor.

mixed
execute( string $route)

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

setControllerPrefix( string $prefix)

Set the controller name prefix.

setDefaultController( string $name)

Set the default controller name.

addMap( string $pattern, string $controller)

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

addMaps( array $maps)

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

Details

__construct( JApplicationWeb $app, JInput $input = null)

Constructor.

Parameters

JApplicationWeb $app The web application on whose behalf we are routing the request.
JInput $input An optional input object from which to derive the route. If none is given than the input from the application object will be used.

mixed execute( string $route)

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

Parameters

string $route The route string for which to find and execute a controller.

Return Value

mixed The return value of the controller executed

Exceptions

InvalidArgumentException
RuntimeException

JApplicationWebRouter setControllerPrefix( string $prefix)

Set the controller name prefix.

Parameters

string $prefix Controller class name prefix for creating controller objects by name.

Return Value

JApplicationWebRouter This object for method chaining.

JApplicationWebRouter setDefaultController( string $name)

Set the default controller name.

Parameters

string $name The default page controller name for an empty route.

Return Value

JApplicationWebRouter This object for method chaining.

JApplicationWebRouter addMap( string $pattern, string $controller)

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

Parameters

string $pattern The route pattern to use for matching.
string $controller The controller name to map to the given pattern.

Return Value

JApplicationWebRouter This object for method chaining.

JApplicationWebRouter addMaps( array $maps)

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

Parameters

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

Return Value

JApplicationWebRouter This object for method chaining.