ApiRouter
Extends \Joomla\Router\RouterJoomla! API Router class
since |
4.0.0 |
---|---|
package |
Joomla CMS |
Methods
__construct
Constructor.
__construct(\Joomla\CMS\Application\CMSApplicationInterface app, array maps = []) : mixed
since |
1.0 |
---|
Arguments
- app
\Joomla\CMS\Application\CMSApplicationInterface
The application object- maps
array
An optional array of route maps
Response
mixed
createCRUDRoutes
Creates routes map for CRUD
createCRUDRoutes(string baseName, string controller, array defaults = [], bool publicGets = false) : void
since |
4.0.0 |
---|
Arguments
- baseName
string
The base name of the component.- controller
string
The name of the controller that contains CRUD functions.- defaults
array
An array of default values that are used when the URL is matched.- publicGets
bool
Allow the public to make GET requests.
getMatchingRoutes
Extract routes matching current route from all known routes.
getMatchingRoutes() : \Joomla\Router\Route[]
since |
4.0.0 |
---|
Response
\Joomla\Router\Route[]
getRoutePath
Get the path from the route and remove and leading or trailing slash.
getRoutePath() : string
since |
4.0.0 |
---|
Response
string
parseApiRoute
Parse the given route and return the name of a controller mapped to the given route.
parseApiRoute(string method = 'GET') : array
since |
4.0.0 |
---|---|
throws |
|
Arguments
- method
string
Request method to match. One of GET, POST, PUT, DELETE, HEAD, OPTIONS, TRACE or PATCH
Response
array
An array containing the controller and the matched variables.
removeIndexPhpFromPath
Removes the index.php from the route's path.
removeIndexPhpFromPath(string path) : string
since |
4.0.0 |
---|
Arguments
- path
string
The path
Response
string