protected function LegacyUrlMatcher::convertDrupalItem

Converts a Drupal menu item to a route array.

Parameters

array $router_item: The Drupal menu item.

Return value

An array of parameters.

1 call to LegacyUrlMatcher::convertDrupalItem()
LegacyUrlMatcher::matchRequest in drupal/core/lib/Drupal/Core/LegacyUrlMatcher.php
@api

File

drupal/core/lib/Drupal/Core/LegacyUrlMatcher.php, line 154
Definition of Drupal\Core\LegacyUrlMatcher.

Class

LegacyUrlMatcher
UrlMatcher matches URL based on a set of routes.

Namespace

Drupal\Core

Code

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;
}