rudiedirkx/Rudie-on-wheels — Issue #36: Implement Rails' routing system in favor of ... everything
Author: rudiedirkx
Created: 2011-12-29 22:14:42+00:00
State: open

The ROW `Router` can stay. It's only meant for `URI > URI`.

The ROW `Dispatcher` will change completely. Some **easy** config for **all** direct routes is required. Rails style. **Only** these routes will be available. (This config will contain only controllers.)

Sort of:

/blog => blogController
/blog/user => blog/userController
/admin => adminController
/admin/clubs => admin/clubsController
/admin/clubs/# => admin/clubs_NController
/admin/rules => admin/rulesController

etc

and then a smart sort to get the specifics first. And then regex the request URI.

New Dispatcher steps:

1. Use Router for URI => URI
2. Get direct routes (sorted)
3. Match URI to Controller from the top
4. Match Action with Arguments (like current Dispatcher: optional/required args)
5. If 4. matched but 5. didn't, do 4. + 5. again (starting with next direct route)

The last direct route should be `/`, because the fallback fits in there.

Or should `/` be the first? It **is** the first (most?) requested URI...