justinfagnani / route

A client + server routing library for Dart
BSD 3-Clause "New" or "Revised" License
114 stars 40 forks source link

Add named path params #52

Closed sethladd closed 11 years ago

sethladd commented 11 years ago

Something like this is common in other routing packages:

new UrlPattern(r'(.*)#/match/(matchId:\d+)');

So I can get this:

..addHandler(matchPath, (String path, Map options) {
  options['matchId'] ...

That would be great. :)

Also, I'd love to get the route options in the handler callback. Parsing it again feels weird, especially since that forces me to pull the pattern out as a variable. And I'm sure the URL was already parsed to find a match.

justinfagnani commented 11 years ago

Functionality like this is coming in the 0.5 branch which uses UriTemplates and named parameters.

What are "route options"?

sethladd commented 11 years ago

options are the name/values pulled from the URL. There's probably a better name.

justinfagnani commented 11 years ago

Yes, those are query parameters. UriTemplate does a much better job at this.

sethladd commented 11 years ago

Marking as fixed, looks like new version of route has what I need.