Xeoncross/micromvc — pull request #24 by johnpbloch (2012-06-15 19:43:17+00:00)
Title: Modify how the \Core\Dispatch::controller method looks for a method to run

This will allow `\Core\Dispatch::controller` to specify non RESTful methods. Before, any non-restful methods would get reset to `run`.

So, for example, right now controllers can do this:

$this->dispatch->controller( $someRoute, $method );

but `$method` will be set to `run` if either of the following is true:

1. The method doesn't exist for the route's controller
2. The method isn't in the array of RESTful actions

I've thrown together a slightly different way for handling this:

If both of the following are true

1. The method *IS* in the array of RESTful actions, AND
2. The method doesn't exist,

set the method to `run`. Then, if the method still doesn't exist, throw an exception.

This allows any public method of a controller to be invoked this way, which I think makes much more sense. It will also make it easier for controllers to make their code more modular and to easily separate the RESTful actions from other actions

For example, a blog controller could have a restful method for displaying the main blog feed and then also a `latest_posts` method for displaying just the latest posts in the sidebar on other sections of the site.