O'Reilly logo

Pro PHP MVC by Chris Pitt

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required