chaplinjs/chaplin — pull request #243 by mehcode (2012-10-19 11:40:53+00:00)
Title: Initial work on allowing the reversal of routes by name

This is for gh-59.

```coffeescript

# First declare routes as follows (optionally so, of course)
(match) ->
match 'param/:one', 'controller#action', name: 'monday'
match 'param/:two', 'controller#action', name: 'tuesday'

# Now to get the url from a route name do the following
@publishEvent '!router:reverse', 'monday', {one: 51}, (url) ->
# url is now 'param/51'

# To expose so that template engines can use it easier you
# can do the following (inside app.coffee):
initMediator: ->
mediator.reverse = => @router.reverse.apply this, arguments
# .. seal and other things you may do ..

```