zf-fr / zfr-rest

A module for Zend Framework 2 that aims to simplify RESTful
81 stars 31 forks source link

Support for RFC 6570-style URI templates #10

Open nimajneb opened 11 years ago

nimajneb commented 11 years ago

While trying to implement the Hypertext Application Language specification in one of my projects I stumbled upon the issue on how to construct a templated URI like this:

"find": { "href": "/orders{?id}", "templated": true }

As it seems there is currently no elegant way to retrieve a previously defined route and its variables from within a ZF2 controller, so maybe it would be nice to have a custom route that exposes some kind of API to get the variable URI parts or maybe even supports that proposed standard RFC 6570?

Ocramius commented 11 years ago

@DASPRiD do you think the syntax of RFC 6570 could be used also in core?

@nimajneb this is awesome input, and we'll probably end up handling this once we get at working at the HATEOAS part (later milestone)