public static function RestfulBase::getPageArguments in RESTful 7
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.
2 calls to RestfulBase::getPageArguments()
- RestfulBase::getVersionFromRequest in plugins/
restful/ RestfulBase.php - Gets the major and minor version for the current request.
- restful_get_restful_handler_for_path in ./
restful.module - Helper function to get the restful handler for the selected path.
File
- plugins/
restful/ RestfulBase.php, line 1609 - Contains RestfulBase.
Class
- RestfulBase
- Class \RestfulBase
Code
public 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;
}