1 | <?php |
||
10 | abstract class Controller |
||
11 | { |
||
12 | /** |
||
13 | * System configuration |
||
14 | * |
||
15 | * @var Config |
||
16 | */ |
||
17 | protected $configuration; |
||
18 | |||
19 | /** |
||
20 | * Instantiated router class pointer |
||
21 | * |
||
22 | * @var Router |
||
23 | */ |
||
24 | protected $router; |
||
25 | |||
26 | /** |
||
27 | * Instantiated request class pointer |
||
28 | * |
||
29 | * @var Request |
||
30 | */ |
||
31 | protected $request; |
||
32 | |||
33 | /** |
||
34 | * League\Container |
||
35 | * |
||
36 | * @var DIContainer |
||
37 | */ |
||
38 | protected $container; |
||
39 | |||
40 | /** |
||
41 | * Instantiated output class pointer |
||
42 | * |
||
43 | * @var object |
||
44 | */ |
||
45 | protected $output; |
||
46 | |||
47 | /** |
||
48 | * @var View |
||
49 | */ |
||
50 | protected $view; |
||
51 | |||
52 | /** |
||
53 | * Load up some basic configuration settings. |
||
54 | */ |
||
55 | public function __construct() |
||
58 | |||
59 | public function setView(View $view) |
||
60 | { |
||
61 | $this->view = $view; |
||
62 | //@TODO instead of "getview" this needs to be "setResponse" -- set response should receive a view, |
||
63 | //views probably don't need config, router, or request -- but they need access |
||
64 | //to methods inside of there. |
||
65 | // I'm not sure how I want to handle this yet. |
||
66 | // return new View($this->configuration, $this->router, $this->request); |
||
67 | } |
||
68 | |||
69 | public function setConfig(Config $config) |
||
73 | |||
74 | public function getConfig() : Config |
||
78 | |||
79 | public function setRouter(Router $router) |
||
83 | |||
84 | public function getRouter() : Router |
||
88 | |||
89 | public function setRequest(Request $request) |
||
93 | |||
94 | public function getRequest() : Request |
||
98 | |||
99 | public function setContainer(DIContainer $container) |
||
103 | |||
104 | public function getContainer() : DIContainer |
||
108 | |||
109 | public function loadModule($name) |
||
122 | } |
||
123 |