Question

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

Was it helpful?

Solution

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.

OTHER TIPS

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/

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top