Last updated February 17, 2015. Created on October 28, 2013.
Edited by sidharrell, nedjo, a_thakur, webchick. Log in to edit this page.

This routing system replaces the routing parts of hook_menu() in Drupal 7. The parts of hook_menu() that were used for creating menu entries, tabs, actions and contextual links are taken over by other subsystems.

Overview

A route is a path which is defined for Drupal to return some sort of content on. For example, the default front page, '/node' is a route. When Drupal receives a request, it tries to match the requested path to a route it knows about. If the route is found, then the route's definition is used to return content. Otherwise, Drupal returns a 404.

Routes and controllers

Drupal's routing system works with the Symfony HTTP Kernel. However, you don't need to know very much about the Symfony HTTP Kernel to do basic route operations. This is how the components relate to each other:

Drupal8Routing.png

The routing system is responsible for matching paths to controllers, and you define those relations in routes. You can pass on additional information to your controllers in the route. Access checking is integrated as well.

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.