1 | <?php |
||
11 | * |
||
12 | * @author Zechariah Walden<zech @ zewadesign.com> |
||
13 | */ |
||
14 | //can name spaces be removed in the classes extending..? |
||
15 | abstract class Controller |
||
16 | { |
||
17 | /** |
||
18 | * System configuration |
||
19 | * |
||
20 | * @var Config |
||
21 | */ |
||
22 | protected $configuration; |
||
23 | |||
24 | /** |
||
25 | * Instantiated router class pointer |
||
26 | * |
||
27 | * @var Router |
||
28 | */ |
||
29 | protected $router; |
||
30 | |||
31 | /** |
||
32 | * Instantiated request class pointer |
||
33 | * |
||
34 | * @var Request |
||
35 | */ |
||
36 | protected $request; |
||
37 | |||
38 | /** |
||
39 | * League\Container |
||
40 | * |
||
41 | * @var DIContainer |
||
42 | */ |
||
43 | protected $container; |
||
44 | |||
45 | /** |
||
46 | * Instantiated output class pointer |
||
47 | * |
||
48 | * @var object |
||
49 | */ |
||
50 | protected $output; |
||
51 | |||
52 | /** |
||
53 | * @var View |
||
54 | */ |
||
55 | protected $view; |
||
56 | |||
57 | /** |
||
58 | * Load up some basic configuration settings. |
||
59 | */ |
||
60 | public function __construct() |
||
61 | { |
||
62 | } |
||
63 | |||
64 | public function setView(View $view) |
||
65 | { |
||
66 | $this->view = $view; |
||
67 | //@TODO instead of "getview" this needs to be "setResponse" -- set response should receive a view, |
||
68 | //views probably don't need config, router, or request -- but they need access |
||
69 | //to methods inside of there. |
||
70 | // I'm not sure how I want to handle this yet. |
||
71 | // return new View($this->configuration, $this->router, $this->request); |
||
72 | } |
||
73 | |||
74 | public function setConfig(Config $config) |
||
75 | { |
||
76 | $this->configuration = $config; |
||
77 | } |
||
114 |