Explorar el Código

Implementing middlewares 0.4

ahwelp hace 7 años
padre
commit
e5b91dd81f
Se han modificado 1 ficheros con 5 adiciones y 2 borrados
  1. 5 2
      src/BBRouter/RouteCollection.php

+ 5 - 2
src/BBRouter/RouteCollection.php

@@ -275,8 +275,11 @@ class RouteCollection{
         $this->_routes[] = $route;
     }
 
-    function addMiddleware($name = '', $function){
-        $this->_default_middlewares[$name] = $function;
+    /*
+     *
+     */
+    static function addMiddleware($name = '', $function){
+        self::getInstance()->_default_middlewares[$name] = $function;
     }
 
     /*