diff --git a/route.php b/route.php index 322ba66..9c165a5 100644 --- a/route.php +++ b/route.php @@ -26,6 +26,8 @@ class route // Provide the the class catch errors in routing. // Must be provided in an array(class,method); public $errors = null; + /** Preroute used in modules */ + public $preroute = ""; /** Return the baseURL of the site Always finish with a slash @@ -263,6 +265,7 @@ class route @param function $function Function to be executed if the route match */ public function get ($route, $function) { + $route = $this->preroute.$route; if ($this->debug) echo "
==> GET $route ?? ";
     if ($this->method () !== "GET")
@@ -284,6 +287,7 @@ class route
       @param function $function Function to be executed if the route match */
   public function post ($route, $function)
   {
+    $route = $this->preroute.$route;
     if ($this->debug)
       echo "
==> POST $route ?? ";
     if ($this->method () !== "POST")
@@ -305,6 +309,7 @@ class route
       @param function $function Function to be executed if the route match */
   public function put ($route, $function)
   {
+    $route = $this->preroute.$route;
     if ($this->debug)
       echo "
==> PUT $route ?? ";
     if ($this->method () !== "PUT")
@@ -326,6 +331,7 @@ class route
       @param function $function Function to be executed if the route match */
   public function delete ($route, $function)
   {
+    $route = $this->preroute.$route;
     if ($this->debug)
       echo "
==> DELETE $route ?? ";
     if ($this->method () !== "DELETE")