JApplicationWebRouterRest
Extends \JApplicationWebRouterBaseRESTful Web application router class for the Joomla Platform.
since |
3.0 |
---|---|
deprecated |
4.0 Use the |
package |
Joomla.Platform |
Methods
__construct
Constructor.
__construct(\JApplicationWeb $app, \JInput $input = null)
since |
3.0 |
---|
Arguments
- $app
\JApplicationWeb
The web application on whose behalf we are routing the request.- $input
\JInput
An 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 |
3.0 |
---|
Arguments
- $pattern
string
The route pattern to use for matching.- $controller
string
The controller name to map to the given pattern.
Response
\JApplicationWebRouter
This 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 |
3.0 |
---|
Arguments
- $maps
array
A list of route maps to add to the router as $pattern => $controller.
Response
\JApplicationWebRouter
This object for method chaining.
execute
Find and execute the appropriate controller based on a given route.
execute(string $route) : mixed
since |
3.0 |
---|---|
throws |
|
Arguments
- $route
string
The route string for which to find and execute a controller.
Response
mixed
The return value of the controller executed
fetchController
Get a JController object for a given name.
fetchController(string $name) : \JController
since |
3.0 |
---|---|
throws |
|
Arguments
- $name
string
The controller name (excluding prefix) for which to fetch and instance.
Response
fetchControllerSuffix
Get the controller class suffix string.
fetchControllerSuffix() : string
since |
3.0 |
---|---|
throws |
|
Response
string
isMethodInPostRequest
Get the property to allow or not method in POST request
isMethodInPostRequest() : boolean
since |
3.0 |
---|
Response
boolean
parseRoute
Parse the given route and return the name of a controller mapped to the given route.
parseRoute(string $route) : string
since |
3.0 |
---|---|
throws |
|
Arguments
- $route
string
The route string for which to find and execute a controller.
Response
string
The controller name for the given route excluding prefix.
setControllerPrefix
Set the controller name prefix.
setControllerPrefix(string $prefix) : \JApplicationWebRouter
since |
3.0 |
---|
Arguments
- $prefix
string
Controller class name prefix for creating controller objects by name.
Response
\JApplicationWebRouter
This object for method chaining.
setDefaultController
Set the default controller name.
setDefaultController(string $name) : \JApplicationWebRouter
since |
3.0 |
---|
Arguments
- $name
string
The default page controller name for an empty route.
Response
\JApplicationWebRouter
This object for method chaining.
setHttpMethodSuffix
Set a controller class suffix for a given HTTP method.
setHttpMethodSuffix(string $method, string $suffix) : \JApplicationWebRouter
since |
3.0 |
---|
Arguments
- $method
string
The HTTP method for which to set the class suffix.- $suffix
string
The class suffix to use when fetching the controller name for a given request.
Response
\JApplicationWebRouter
This object for method chaining.
setMethodInPostRequest
Set to allow or not method in POST request
setMethodInPostRequest(boolean $value) : void
since |
3.0 |
---|
Arguments
- $value
boolean
A boolean to allow or not method in POST request
Properties
methodInPostRequest
A boolean allowing to pass _method as parameter in POST requests
since |
3.0 |
---|
Type(s)
boolean
suffixMap
An array of HTTP Method => controller suffix pairs for routing the request.
since |
3.0 |
---|
Type(s)
array
maps
An array of rules, each rule being an associative array('regex'=> $regex, 'vars' => $vars, 'controller' => $controller) for routing the request.
since |
3.0 |
---|
Type(s)
array
app
The web application on whose behalf we are routing the request.
since |
3.0 |
---|
Type(s)
\JApplicationWeb
default
The default page controller name for an empty route.
since |
3.0 |
---|
Type(s)
string
controllerPrefix
Controller class name prefix for creating controller objects by name.
since |
3.0 |
---|
Type(s)
string
input
An input object from which to derive the route.
since |
3.0 |
---|
Type(s)
\JInput