You are here

protected static function ResourceManager::getPageArguments in RESTful 7.2

Get the resource name and version from the page arguments in the router.

Parameters

string $path: The path to match the router item. Leave it empty to use the current one.

Return value

array An array of 2 elements with the page arguments.

3 calls to ResourceManager::getPageArguments()
ResourceManager::getResourceIdFromRequest in src/Resource/ResourceManager.php
Get the resource name for the current request.
ResourceManager::getVersionFromRequest in src/Resource/ResourceManager.php
Gets the major and minor version for the current request.
ResourceManager::negotiate in src/Resource/ResourceManager.php
Gets the resource plugin based on the information in the request object.

File

src/Resource/ResourceManager.php, line 222
Contains \Drupal\restful\Resource\ResourceManager.

Class

ResourceManager

Namespace

Drupal\restful\Resource

Code

protected static function getPageArguments($path = NULL) {
  $router_item = static::getMenuItem($path);
  $output = array(
    NULL,
    NULL,
  );
  if (empty($router_item['page_arguments'])) {
    return $output;
  }
  $page_arguments = $router_item['page_arguments'];
  $index = 0;
  foreach ($page_arguments as $page_argument) {
    $output[$index] = $page_argument;
    $index++;
    if ($index >= 2) {
      break;
    }
  }
  return $output;
}