0

i am making my own small jsmvc lib, and now i want a simple routing lib for my small framwork, i am just wiring up open source libs together to make it work according to my needs,

and now i want a simple url routing componet in my framwork, which can map urls like

"customUrl/:param1" to "module/controller/action/param1/value1" to path format

and i also want to create Urls from router like "roter.createUrl(module/controller/action,{params1:value1});" to make my rules easy to maintain,

can you please suggest me some good libs or source which have similar functionally.

dev.meghraj
  • 8,542
  • 5
  • 38
  • 76
  • What's wrong with BackboneJS's router? You tagged your question with it for some reason. As written, your question currently isn't a good fit for SO == http://stackoverflow.com/faq – WiredPrairie Mar 26 '13 at 13:42
  • why? backbone is base for most of mvcs out there.. – dev.meghraj Mar 28 '13 at 08:48

1 Answers1

0

ok finnally using crossroads js , and passing route as some custom function

addRule:function(pattern, path) {
    var self = this;
    this.router.addRoute(pattern, function() {
        var res = self.resolvePathFormat(path);
        self.dispatch(res.module, res.controller, res.action, res.params);
    });
},
Zac Seth
  • 2,742
  • 5
  • 37
  • 56
dev.meghraj
  • 8,542
  • 5
  • 38
  • 76