JApplicationWebRouter

Class to define an abstract Web application router.

abstract 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) 
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.

execute

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

execute(string $route) : mixed
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
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
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
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
since

12.2

Arguments

$name

stringThe default page controller name for an empty route.

Response

\JApplicationWebRouterThis object for method chaining.

Properties

app

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

Type(s)

\JApplicationWeb

default

The default page controller name for an empty route.

Type(s)

string

controllerPrefix

Controller class name prefix for creating controller objects by name.

Type(s)

string

input

An input object from which to derive the route.

Type(s)

\JInput