Converts a Drupal menu item to a route array.
array $router_item: The Drupal menu item.
An array of parameters.
protected function convertDrupalItem($router_item) {
$route = array(
'_controller' => $router_item['page_callback'],
);
// A few menu items have a fake page callback temporarily. Skip those,
// we aren't going to route them.
if ($router_item['page_callback'] == 'USES_ROUTE') {
throw new ResourceNotFoundException();
}
// @todo menu_get_item() does not unserialize page arguments when the access
// is denied. Remove this temporary hack that always does that.
if (!is_array($router_item['page_arguments'])) {
$router_item['page_arguments'] = unserialize($router_item['page_arguments']);
}
// Place argument defaults on the route.
foreach ($router_item['page_arguments'] as $k => $v) {
$route[$k] = $v;
}
return $route;
}