Pārlūkot izejas kodu

fixed route http method; added basic parameter regex

tags/0.1.0
Robin Thoni 9 gadus atpakaļ
vecāks
revīzija
1d363f66fc
1 mainītis faili ar 7 papildinājumiem un 2 dzēšanām
  1. 7
    2
      src/Utils/LuRoute.php

+ 7
- 2
src/Utils/LuRoute.php Parādīt failu

@@ -3,6 +3,11 @@
3 3
 namespace Luticate\Utils;
4 4
 
5 5
 class LuRoute {
6
+
7
+    const REG_UINT = "[0-9]+";
8
+    const REG_INT = "\\-?" . self::REG_INT;
9
+    const REG_BOOL = "true|false";
10
+
6 11
     /**
7 12
      * @var string[]
8 13
      */
@@ -44,7 +49,7 @@ class LuRoute {
44 49
         $this->middleware[] = $middleware;
45 50
     }
46 51
 
47
-    private function getOptions($method, $url, $business, $method, $permissions, $middleware)
52
+    private function getOptions($httpMethod, $url, $business, $method, $permissions, $middleware)
48 53
     {
49 54
         if (!is_array($permissions)) {
50 55
             $permissions = array($permissions);
@@ -68,7 +73,7 @@ class LuRoute {
68 73
         $route->setBusinessClass($business);
69 74
         $route->setMiddlware($middleware_string);
70 75
         $route->setPermissions($permissions);
71
-        $route->setMethod($method);
76
+        $route->setMethod($httpMethod);
72 77
         $this->routes[] = $route;
73 78
 
74 79
         return [function() use($business, $method)

Notiek ielāde…
Atcelt
Saglabāt