-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathUrlInterface.php
More file actions
executable file
·132 lines (110 loc) · 2.95 KB
/
UrlInterface.php
File metadata and controls
executable file
·132 lines (110 loc) · 2.95 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
119
120
121
122
123
124
125
126
127
128
129
130
131
132
<?php
namespace MaplePHP\Http\Interfaces;
use Psr\Http\Message\UriInterface;
interface UrlInterface
{
/**
* Access http PSR URI message
* @return UriInterface
*/
public function getUri(): UriInterface;
/**
* With URI path type key
* @param null|string|array $type
* @return static
*/
public function withType(null|string|array $type): self;
/**
* Same as withType except that you Need to select a part
* @param string|array $type
* @return static
*/
public function select(string|array $type): self;
/**
* Same as withType except it will only reset
* @return static
*/
public function reset(): self;
/**
* Add to URI path
* @param array|string $arr
* @return static
*/
public function add(array|string $arr): self;
/**
* Get real htaccess path (possible directories filtered out)
* @return string
*/
public function getRealPath(): string;
/**
* Extract and get directories from the simulated htaccess path
* @return string
*/
public function getDirPath(): string;
/**
* Get vars/path as array
* @return array
*/
public function getVars(): array;
/**
* Get vars/path as array
* @return array
*/
public function getParts(): array;
/**
* Get expected slug from path
* @return string
*/
public function get(): string;
/**
* Get expected slug from path
* @return string
*/
public function current(): string;
/**
* Get first path item
* @return string
*/
public function first(): string;
/**
* Get travers to prev path item
* @return string
*/
public function prev(): string;
/**
* Get travers to next path item
* @return string
*/
public function next(): string;
/**
* Get last path item
* @return string
*/
public function last(): string;
/**
* Get root URL
* @param string $path add to URI
* @param bool $endSlash add slash to the end of root URL (default false)
* @return string
*/
public function getRoot(string $path = "", bool $endSlash = false): string;
/**
* Get root URL DIR
* @param string $path add to URI
* @param bool $endSlash add slash to the end of root URL (default false)
* @return string
*/
public function getRootDir(string $path = "", bool $endSlash = false): string;
/**
* Get full URL (path is changeable with @add and @withType method)
* @param string $addToPath add to URI
* @return string
*/
public function getUrl(string $addToPath = ""): string;
/**
* Not required but recommended. You can pass on URL shortcuts to the class
* E.g. getPublic, getCss
* @param UrlHandlerInterface $handler
*/
public function setHandler(UrlHandlerInterface $handler): void;
}