Skip to content

Loading…

add special group which captures till end of string #43

Closed
millermedeiros opened this Issue · 1 comment

1 participant

@millermedeiros

@koistya suggested on #42 a new type of capturing group {id*}

// {id*} matches the rest of the path including / symbols
crossroads.addRoute('{controller}/{action}/{id*}');

this might be useful in a few cases.

@millermedeiros

Right now the way to do it is using a RegExp instead of a string:

crossroads.addRoute(/(.+)\/(.+)\/(.+)/);

Crossroads is flexible enough but since a lot of people don't understand RegExp it is a good idea to include this kind of feature.

This feature should also work with optional segments, so the RegExp for optional segments should be .* and for required segments .+

@millermedeiros millermedeiros added a commit that referenced this issue
@millermedeiros Merge branch 'dev'
* dev:
  add rest segment support. closes #43. bumps version to 0.8.0.
  add defaultArgs to crossroads.parse to make it easier to use on node.js. closes #44
  revert normalization behavior to using constants instead of methods. closes #31
  change build to nodejs
  add methods to toggle normalize behavior. closes #31
  add switched signal. see #37.
0cf0d9c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.