Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.3.3

Request #18916 Provide URI Template Matching
Submitted: 2011-10-20 02:26 UTC
From: bradley Assigned:
Status: Open Package: URI_Template (version 0.3.3)
PHP Version: Irrelevant OS: N/A
Roadmaps: (Not assigned)    
Subscription  


 [2011-10-20 02:26 UTC] bradley (Bradley Holt)
Description: ------------ Please consider implementing URI Template matching. Given a URI-reference and a set of URI Templates, indicate which URI Template(s) matched. I would like to see web frameworks start using URI Templates for both routing and URI expansion, and this component could serve as the base for this functionality. Test script: --------------- $templates = array( new URI_Template("http://example.org/{foo=%25}/"), new URI_Template("http://example.org/?{-join|&|a,data}"), new URI_Template("http://example.org/?d={-listjoin|,|points}&{-join|&|a,b}") ); $matcher = new URI_Template_Matcher($templates); $matches = $matcher->match('http://example.org/?a=foo&data=10%2C20%2C30'); print_r($matches); Expected result: ---------------- Array ( [0] => URI_Template Object ( [template:protected] => http://example.org/?{-join|&|a,data} [values:protected] => Array ( ) ) ) Actual result: -------------- There is no URI_Template_Matcher class.

Comments