1 | <?php |
||
11 | class Controller { |
||
12 | |||
13 | /** |
||
14 | * Storage of cur requested controller |
||
15 | * |
||
16 | * @var Controller |
||
17 | */ |
||
18 | public static $cur = null; |
||
19 | |||
20 | /** |
||
21 | * Requested params for method |
||
22 | * |
||
23 | * @var array |
||
24 | */ |
||
25 | public $params = []; |
||
26 | |||
27 | /** |
||
28 | * Path to controller dir |
||
29 | * |
||
30 | * @var string |
||
31 | */ |
||
32 | public $path = ''; |
||
33 | |||
34 | /** |
||
35 | * Requested action name |
||
36 | * |
||
37 | * @var string |
||
38 | */ |
||
39 | public $method = 'index'; |
||
40 | |||
41 | /** |
||
42 | * Module of this controller |
||
43 | * |
||
44 | * @var Module |
||
45 | */ |
||
46 | public $module = null; |
||
47 | |||
48 | /** |
||
49 | * This controller name |
||
50 | * |
||
51 | * @var string |
||
52 | */ |
||
53 | public $name = ''; |
||
54 | |||
55 | /** |
||
56 | * Flag of controller runing |
||
57 | * |
||
58 | * @var boolean |
||
59 | */ |
||
60 | public $run = false; |
||
61 | |||
62 | public $methodResolved = false; |
||
63 | |||
64 | /** |
||
65 | * Run controller |
||
66 | */ |
||
67 | public function run() { |
||
79 | |||
80 | public function resolveMethod() { |
||
92 | |||
93 | /** |
||
94 | * Reference to short access core modules |
||
95 | * |
||
96 | * @param $name |
||
97 | * @return Module|null |
||
98 | */ |
||
99 | public function __get($name) { |
||
102 | |||
103 | /** |
||
104 | * Reference to short access core modules |
||
105 | * |
||
106 | * @param $name |
||
107 | * @param $params |
||
108 | * @return null|Module |
||
109 | */ |
||
110 | public function __call($name, $params) { |
||
113 | |||
114 | /** |
||
115 | * Check access to controller method |
||
116 | * |
||
117 | * @return boolean |
||
118 | */ |
||
119 | public function checkAccess() { |
||
125 | |||
126 | } |
||
127 |