UnionOfRAD/lithium — pull request #408 by rmarscher (2012-03-30 18:00:48+00:00)
Title: Dispatcher rules callback

I'd like to be able to normalize my actions in urls.

For example, /some-controller/some-action would be able to be routed to SomeController::someAction. It seems that the only method currently available to do that would be to subclass `lithium\action\Dispatcher`.

I added the capability to use a callback for the Dispatcher rules. That way I can do this:

use lithium\action\Dispatcher;
use lithium\util\Inflector;

Dispatcher::config(array('rules' => array(
'action' => array('action' => function($params) {
return Inflector::camelize(strtolower($params['action']), false);
})
)));

Hope you like it.