-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGroup.hh
81 lines (69 loc) · 1.6 KB
/
Group.hh
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
<?hh // strict
/**
* @copyright 2010-2015, The Titon Project
* @license http://opensource.org/licenses/bsd-license.php
* @link http://titon.io
*/
namespace Titon\Route;
use Titon\Route\Mixin\ConditionMixin;
use Titon\Route\Mixin\FilterMixin;
use Titon\Route\Mixin\MethodMixin;
use Titon\Route\Mixin\PatternMixin;
use Titon\Route\Mixin\SecureMixin;
/**
* The Group is used in the defining and passing of information from the group to every Route within the group.
* A group is triggered from the `Router::group()` method.
*
* @package Titon\Route
*/
class Group {
use ConditionMixin, FilterMixin, MethodMixin, PatternMixin, SecureMixin;
/**
* Prefix to prepend to all route paths.
*
* @var string
*/
protected string $prefix = '';
/**
* Suffix to append to all route paths.
*
* @var string
*/
protected string $suffix = '';
/**
* Return the prefix.
*
* @return string
*/
public function getPrefix(): string {
return $this->prefix;
}
/**
* Return the suffix.
*
* @return string
*/
public function getSuffix(): string {
return $this->suffix;
}
/**
* Set the prefix.
*
* @param string $prefix
* @return $this
*/
public function setPrefix(string $prefix): this {
$this->prefix = $prefix;
return $this;
}
/**
* Set the suffix.
*
* @param string $suffix
* @return $this
*/
public function setSuffix(string $suffix): this {
$this->suffix = $suffix;
return $this;
}
}