-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathRoutesInterface.php
More file actions
118 lines (108 loc) · 2.55 KB
/
RoutesInterface.php
File metadata and controls
118 lines (108 loc) · 2.55 KB
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<?php
/**
* Arikaim
*
* @link http://www.arikaim.com
* @copyright Copyright (c) Konstantin Atanasov <info@arikaim.com>
* @license http://www.arikaim.com/license
*
*/
namespace Arikaim\Core\Interfaces;
/**
* Routes interface
*/
interface RoutesInterface
{
/**
* Route type constant
*/
const PAGE = 1;
const API = 2;
const HOME_PAGE = 3;
const ADMIN_API = 4;
/**
* Get home page route
*
* @return array
*/
public function getHomePageRoute();
/**
* Get route
*
* @param string $method
* @param string $pattern
* @return array|false
*/
public function getRoute(string $method, string $pattern);
/**
* Get routes list for request method
*
* @param string $method
* @return array
*/
public function searchRoutes(string $method, $type = null);
/**
* Save route redirect url
*
* @param string $method
* @param string $pattern
* @param string $url
* @return boolean
*/
public function setRedirectUrl(string $method, string $pattern, string $url): bool;
/**
* Set routes status
*
* @param array $filterfilter
* @param integer $status
* @return boolean
*/
public function setRoutesStatus(array $filter, int $status): bool;
/**
* Add api route
*
* @param string $method
* @param string $pattern
* @param string $handlerClass
* @param string|null $handlerMethod
* @param string|null $extension
* @param integer|string|null $auth
* @param int $type
* @return bool
* @throws Exception
*/
public function addApiRoute(
string $method,
string $pattern,
string $handlerClass,
?string $handlerMethod,
?string $extension,
?string $auth = null,
int $type = RoutesInterface::API
): bool;
/**
* Return true if reoute exists
*
* @param string $method
* @param string $pattern
* @return boolean
*/
public function has(string $method, string $pattern): bool;
/**
* Delete route
*
* @param string $method
* @param string $pattern
* @return bool
*/
public function delete(string $method, string $pattern): bool;
/**
* Save route options
*
* @param string $method
* @param string $pattern
* @param array $options
* @return boolean
*/
public function saveRouteOptions(string $method, string $pattern, $options): bool;
}