Back to Joomla project (class list)

Class ApiRouter - list of methods

Joomla! API Router class
Package: Joomla\CMS\Router
Copyright: (C) 2019 Open Source Matters, Inc.
License: GNU General Public License version 2 or later; see LICENSE.txt
Located at: Joomla/Router/ApiRouter.php
Project: Joomla

Method Summary

public
(\Joomla\CMS\Application\CMSApplicationInterface $app, array $maps = [])

Constructor.
Parameters
  • \Joomla\CMS\Application\CMSApplicationInterface $app The application object
  • array $maps An optional array of route maps
Since
  • 1.0
Show source code of this method: __construct Source Code

public void
(mixed $baseName, mixed $controller, mixed $defaults = [], mixed $publicGets = false)

Creates routes map for CRUD
Parameters
  • string $baseName The base name of the component.
  • string $controller The name of the controller that contains CRUD functions.
  • array $defaults An array of default values that are used when the URL is matched.
  • bool $publicGets Allow the public to make GET requests.
Returns
  • void
Since
  • 4.0.0
Show source code of this method: createCRUDRoutes Source Code

public array
(mixed $method = 'GET')

Parse the given route and return the name of a controller mapped to the given route.
Parameters
  • string $method Request method to match. One of GET, POST, PUT, DELETE, HEAD, OPTIONS, TRACE or PATCH
Returns
  • array An array containing the controller and the matched variables.
Since
  • 4.0.0
-
  • \InvalidArgumentException
Show source code of this method: parseApiRoute Source Code

public string
()

Get the path from the route and remove and leading or trailing slash.
Returns
  • string
Since
  • 4.0.0
Show source code of this method: getRoutePath Source Code

private string
(string $path)

Removes the index.php from the route's path.
Parameters
  • string $path The path
Returns
  • string
Since
  • 4.0.0
Show source code of this method: removeIndexPhpFromPath Source Code

public \Joomla\Router\Route[]
()

Extract routes matching current route from all known routes.
Returns
  • \Joomla\Router\Route[]
Since
  • 4.0.0
Show source code of this method: getMatchingRoutes Source Code

Properties Summary

protected \Joomla\CMS\Application\CMSApplicationInterface
$app
The application object
Since
  • 4.0.0

Tags Summary

Since
4.0.0