From e21a5a1840def76813fc736f16904ab38390050d Mon Sep 17 00:00:00 2001 From: Dominique Fournier Date: Thu, 9 Mar 2017 11:03:30 +0000 Subject: [PATCH] route : add the mapRoute function to know the matching route search comparison git-svn-id: https://svn.fournier38.fr/svn/ProgSVN/trunk@3392 bf3deb0d-5f1a-0410-827f-c0cc1f45334c --- route.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/route.php b/route.php index d339991..c7cacfc 100644 --- a/route.php +++ b/route.php @@ -37,6 +37,11 @@ class route * the backend. The objct can be put to null to disable the feature */ public $ratelimiter = null; + /// MAPPING /// + /** The matching route comparison + */ + public $mapRoute = null; + /// RENDERER PART /// /** Output type to no previous catched renderer (allow : json, xml, txt html) */ @@ -304,6 +309,13 @@ class route throw new Exception ("Invalid REQUEST_METHOD", 406); } + /** Return the mached route search + */ + public function mapRoute () + { + return $this->mapRoute; + } + /** If the URL is corresponding with $url, and the method is GET, then the * function is called. * Ex. : $app->get('/hello/{name}', function ($name) { @@ -441,6 +453,7 @@ class route { if ($this->debug) echo "==> FOUND EQUAL !\n"; + $this->mapRoute = $route; try { $data = $function (); @@ -480,6 +493,7 @@ class route { if ($this->debug) echo "==> FOUND REGEX !\n"; + $this->mapRoute = $route; $params = array (); $reflect = new ReflectionFunction ($function); foreach ($reflect->getParameters() as $key=>$val)