millermedeiros/crossroads.js — Issue #34: add a way to generate a string that match route passing parameters
Author: millermedeiros
Created: 2011-11-25 13:32:31+00:00
State: open
Labels: feature

should be trivial to implement if route was generated using a string, probably just need to do a RegExp over `Route._pattern` like [MM_js_lib/microTemplate](https://github.com/millermedeiros/MM_js_lib/blob/master/src/other/microTemplate.js)..

if user don't provide a required parameter it should also throw an error, optional parameters can be omitted.

if route is a RegExp there is no way to do it since we can't figure out what is the string user is trying to build so it should throw an error...

I haven't really needed this feature so far - specially since I'm generating routes dynamically and don't access the routes references after I create them - but I can see it being useful in a few cases.