tags:

views:

55

answers:

2

I'm wondering how vimeo manages to retain its parameters using routing, for example in vimeo, a search uri looks like this:

http://vimeo.com/videos/search:google/, which will return a variable in this case google.

This is easy enough to do, can simply use routes and explodes in php to get the data you require into a useful array, what foxes me is how they managed to get this url to work:

http://vimeo.com/videos/search:go/ogle/, in my mind how does the router know when the section ends, vimeo seems to be able to read it as "go/ogle" yet i cant see how it can tell the difference between a new section and and existing one? why shouldn't it have two keys one as search: the other as ogle:?

Hope this makes sense

+3  A: 

It seems to be not so strict on using / as a delimiter. From tinkering with it on the URL I guess it loads the controller videos (if I can make some guesses) and uses anything after search: as the search term. After search: it doesn't seem divide up parameters.

ctshryock
yeah, i think you're right there, i tried adding some sorting bizzarely it only works upon refresh: http://vimeo.com/videos/search:google/y/sort:oldest/format:thumbnailvery weird, i think i'd filter that stuff out of a search anyway since it has so much potential to mess stuff up!Thanks for the answer :)
Rob
+1  A: 

That looks like a cakePHP URL to me.

The CakePHP PaginatorHelper uses a similar format for paging results and sorting table data, something like:

http: // server.com/videos/page:1/sort:name

Take a look here and work backwards:

http://api.cakephp.org/view_source/paginator-helper/

DrUseful
Thanks for the answer :) after thinking it through, i actually don't see any problem with just using the query string for things like sorting and paging
Rob
DrUseful