Drupal 8 Routing: The Method in the Madness

Click here to watch Drupal 8 Routing: The Method in the Madness.

In almost every aspect, Drupal 8 is embracing Object Oriented programming (OOP). With some notable exceptions (Form API, alter hooks, render arrays), OOP is the way to go.

In Drupal 8, page callbacks have been completely rewritten. Instead of procedural functions, they now utilize Symfony2’s Routing component, and are all methods. Similarly, custom access callbacks are also classes. And many of the visual parts of hook_menu(), like local tasks and actions, are now plugins.

This session assumes basic familiarity with Drupal 7 module development.

Session objectives

This session will explain the many parts of routing, show how to convert from Drupal 7’s menu system to Drupal 8’s routing system, and provide insight into many of the decisions made during the development of the API.

Schedule Information
Experience level: 
Time slot: 
Thursday · 13:00-14:00


Yes please. :) This is the first thing that might trip people up in D8, once they've spent 30 seconds figuring out how to convert their .info files.

One of the things I recently discovered that I found interesting was that you can use the callable notation for static methods to use non-static methods as controllers. Part of the magic of Symfony2 - look forward to learning more in Prague. : )