RestRouter

Extends Router

RESTful Web application router class for the Joomla Framework.

deprecated
since

1.0

deprecated

2.0 Use the base Router class instead

package

Joomla Framework

Methods

__construct

Constructor.

__construct(\Joomla\Input\Input input = null) : mixed
inherited
since

1.0

Arguments

input

\Joomla\Input\InputAn optional input object from which to derive the route.

Response

mixed

addMap

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

addMap(string pattern, string controller) : \Joomla\Router\Router
inherited deprecated
since

1.0

deprecated

2.0 Deprecated without replacement

Arguments

pattern

stringThe route pattern to use for matching.

controller

stringThe controller name to map to the given pattern.

Response

\Joomla\Router\RouterReturns itself to support chaining.

addMaps

Add an array of route maps to the router. If the pattern already exists it will be overwritten.

addMaps(array maps) : \Joomla\Router\Router
inherited deprecated
since

1.0

deprecated

2.0 Deprecated without replacement

Arguments

maps

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

Response

\Joomla\Router\RouterReturns itself to support chaining.

fetchController

Get a Controller object for a given name.

fetchController(string name) : \Joomla\Controller\ControllerInterface
inherited deprecated
since

1.0

throws

\RuntimeException

deprecated

2.0 Deprecated without replacement

Arguments

name

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

Response

\Joomla\Controller\ControllerInterface

fetchControllerSuffix

Get the controller class suffix string.

fetchControllerSuffix() : string
deprecated
since

1.0

throws

\RuntimeException

deprecated

2.0 Use the base Router class instead

Response

string

getController

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

getController(string route) : \Joomla\Controller\ControllerInterface
inherited deprecated
since

1.0

throws

\InvalidArgumentException

\RuntimeException

deprecated

2.0 Deprecated without replacement

Arguments

route

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

Response

\Joomla\Controller\ControllerInterface

isMethodInPostRequest

Get the property to allow or not method in POST request

isMethodInPostRequest() : bool
deprecated
since

1.0

deprecated

2.0 Use the base Router class instead

Response

bool

parseRoute

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

parseRoute(string route) : string
inherited
since

1.0

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) : \Joomla\Router\Router
inherited deprecated
since

1.0

deprecated

2.0 Deprecated without replacement

Arguments

prefix

stringController class name prefix for creating controller objects by name.

Response

\Joomla\Router\RouterReturns itself to support chaining.

setDefaultController

Set the default controller name.

setDefaultController(string name) : \Joomla\Router\Router
inherited deprecated
since

1.0

deprecated

2.0 Deprecated without replacement

Arguments

name

stringThe default page controller name for an empty route.

Response

\Joomla\Router\RouterReturns itself to support chaining.

setHttpMethodSuffix

Set a controller class suffix for a given HTTP method.

setHttpMethodSuffix(string method, string suffix) : \Joomla\Router\Router
deprecated
since

1.0

deprecated

2.0 Use the base Router class instead

Arguments

method

stringThe HTTP method for which to set the class suffix.

suffix

stringThe class suffix to use when fetching the controller name for a given request.

Response

\Joomla\Router\RouterReturns itself to support chaining.

setMethodInPostRequest

Set to allow or not method in POST request

setMethodInPostRequest(bool value) : void
deprecated
since

1.0

deprecated

2.0 Use the base Router class instead

Arguments

value

boolA boolean to allow or not method in POST request

Properties

methodInPostRequest

A boolean allowing to pass _method as parameter in POST requests

deprecated
since

1.0

deprecated

2.0 Use the base Router class instead

Type(s)

bool

suffixMap

An array of HTTP Method => controller suffix pairs for routing the request.

deprecated
since

1.0

deprecated

2.0 Use the base Router class instead

Type(s)

array

controllerPrefix

Controller class name prefix for creating controller objects by name.

inherited deprecated
since

1.0

deprecated

2.0 Deprecated without replacement

Type(s)

string

default

The default page controller name for an empty route.

inherited deprecated
since

1.0

deprecated

2.0 Deprecated without replacement

Type(s)

string

input

An input object from which to derive the route.

inherited deprecated
since

1.0

deprecated

2.0 Deprecated without replacement

Type(s)

\Joomla\Input\Input

maps

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

inherited deprecated
since

1.0

deprecated

2.0 Deprecated without replacement

Type(s)

array