dwsla/slender-api — pull request #1 by papayasoft (2013-02-08 07:29:08+00:00)
Title: feature/unified routing

Overview:

1. I'm starting to use the term "core" to describe cross-site resources, like users, sites, roles, things that use the 'default' db connection. In contrast, things like news, photos, albums, etc are "site-based" resources.

2. We list the three site-based resources - users, roles, sites - in `config/app.php`

3. We use a `ServiceProvider` to register a `route-creator` key in the IoC.

4. In `app/routes.php`, we pull the route-creator object and use it to create the core routes and the site-based routes.

5. Note that the creation of site-based routes is done via an explicit array. This is intended so that the config can be pulled from a model like `Sites`. Alternatively, it is possible that we could just register a `Sites` model with the IoC, make it a dependency in the route-creator, and then have the route-creator use it to get his own site-based route config. Then the call in `app/routes.php` can be as simple as:

`App::make('route-creator')->createRoutes();`

6. All models referenced by the `RouteCreator` are explicitly injected with the correct `LMongo\Database` instance. All controllers referenced by the `RouteCreator` are explicitly injected with the right model.

That's all for now. I'm sleepy. ;-)