-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathAppComponent.php
83 lines (71 loc) · 1.37 KB
/
AppComponent.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
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
<?php
/**
* Application Component Express
*
*/
namespace vuongminh\ac;
use Yii;
/**
* @author Vương Xương Minh <[email protected]>
* @since 1.0
*
* @property \yii\web\Request $request
* @property \yii\web\Response $response
* @property \yii\web\Session $session
* @property \yii\web\User $user
* @property \yii\rbac\ManagerInterface $auth
* @property array $requestPost
* @property array $requestGet
*
*/
trait AppComponent {
/**
*
* @var \yii\web\Request;
*/
public function getRequest() {
return Yii::$app->getRequest();
}
/**
*
* @var array
*/
public function getRequestGet() {
return $this->request->get();
}
/**
*
* @var array
*/
public function getRequestPost() {
return $this->request->post();
}
/**
*
* @var \yii\web\Response
*/
public function getResponse() {
return Yii::$app->getResponse();
}
/**
*
* @var \yii\web\Session
*/
public function getSession() {
return Yii::$app->getSession();
}
/**
*
* @var \yii\web\User;
*/
public function getUser() {
return Yii::$app->getUser();
}
/**
*
* @var \yii\rbac\ManagerInterface;
*/
public function getAuthManager() {
return Yii::$app->getAuthManager();
}
}