1: <?php
2: 3: 4: 5: 6: 7:
8: namespace Core\Route;
9:
10: class Route
11: {
12: protected static $URLS = array();
13:
14: 15: 16: 17: 18:
19: public static function get($path, $classedFunction)
20: {
21: self::$URLS['GET'][$path]=$classedFunction;
22: }
23:
24: 25: 26: 27: 28:
29: public static function post($path, $classedFunction)
30: {
31: self::$URLS['POST'][$path]=$classedFunction;
32: }
33:
34: 35: 36: 37: 38:
39: public static function put($path, $classedFunction)
40: {
41: self::$URLS['PUT'][$path]=$classedFunction;
42: }
43:
44: 45: 46: 47: 48:
49: public static function patch($path, $classedFunction)
50: {
51: self::$URLS['PATCH'][$path]=$classedFunction;
52: }
53:
54: 55: 56: 57: 58:
59: public static function delete($path, $classedFunction)
60: {
61: self::$URLS['DELETE'][$path]=$classedFunction;
62: }
63:
64: 65: 66: 67: 68:
69: public static function head($path, $classedFunction)
70: {
71: self::$URLS['HEAD'][$path]=$classedFunction;
72: }
73:
74: 75: 76: 77: 78:
79: public static function options($path, $classedFunction)
80: {
81: self::$URLS['OPTIONS'][$path]=$classedFunction;
82: }
83:
84: 85: 86: 87: 88:
89: public static function any($path, $classedFunction)
90: {
91: self::get($path,$classedFunction);
92: self::post($path,$classedFunction);
93: self::put($path,$classedFunction);
94: self::patch($path,$classedFunction);
95: self::delete($path,$classedFunction);
96: self::head($path,$classedFunction);
97: self::options($path,$classedFunction);
98: }
99: }
100: