by Chris Pitt

Safari, the world’s most comprehensive technology and business learning platform.

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required

O'Reilly logo

CHAPTER 7

images

Routing

Routing is what happens when an application determines which controllers and actions are executed based on the URL requested. Simply put, it is how the framework gets from http://localhost/users/list.html to the Users controller and the list() action.

Goals

  • We need to understand what routes are and how they work.
  • We need to build the different kinds of routes.
  • We need to build the Router class that will manage these routes.

Defining Routes

Some routes can be inferred from the structure of the application. If the Router class sees that you have an Articles controller with a search() method, if can sometimes assume that the ...

Find the exact information you need to solve a problem on the fly, or go deeper to master the technologies and skills you need to succeed

Start Free Trial

No credit card required