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)