-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRouter.php
39 lines (32 loc) · 903 Bytes
/
Router.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
class Router
{
public static function head($route, $call, $name = null)
{
static::app()->route('HEAD '.($name?'@'.$name.':':'').$route, $call);
}
public static function get($route, $call, $name = null)
{
static::app()->route('GET '.($name?'@'.$name.':':'').$route, $call);
}
public static function post($route, $call, $name = null)
{
self::app()->route('POST '.($name?'@'.$name.':':'').$route, $call);
}
public static function put($route, $call, $name = null)
{
self::app()->route('PUT '.($name?'@'.$name.':':'').$route, $call);
}
public static function delete($route, $call, $name = null)
{
self::app()->route('DELETE '.($name?'@'.$name.':':'').$route, $call);
}
public static function patch($route, $call, $name = null)
{
self::app()->route('PATCH '.($name?'@'.$name.':':'').$route, $call);
}
private static function app()
{
return Base::instance();
}
}