1 | <?php |
||
36 | abstract class AbstractController |
||
37 | { |
||
38 | |||
39 | /** |
||
40 | * @var \Tight\Tight Tight App |
||
41 | */ |
||
42 | private $app; |
||
43 | |||
44 | /** |
||
45 | * @var \Tight\Mvc\AbstractView |
||
46 | */ |
||
47 | private $view; |
||
48 | |||
49 | /** |
||
50 | * @var \Tight\Mvc\AbstractModel |
||
51 | */ |
||
52 | private $model; |
||
53 | |||
54 | public function __construct(AbstractModel $model, AbstractView $view) { |
||
60 | |||
61 | /** |
||
62 | * Gets the Tight App |
||
63 | * @return \Tight\Tight |
||
64 | */ |
||
65 | public function getApp() { |
||
68 | |||
69 | /** |
||
70 | * Gets the view |
||
71 | * @return \Tight\Mvc\AbstractView |
||
72 | */ |
||
73 | public function getView() { |
||
76 | |||
77 | /** |
||
78 | * Gets the model |
||
79 | * @return \Tight\Mvc\AbstractModel |
||
80 | */ |
||
81 | public function getModel() { |
||
84 | |||
85 | /** |
||
86 | * Sets the view |
||
87 | * @param \Tight\Mvc\AbstractView $view View |
||
88 | * @return \Tight\Mvc\AbstractController Fluent setter |
||
89 | */ |
||
90 | public function setView(AbstractView $view) { |
||
94 | |||
95 | /** |
||
96 | * Sets the model |
||
97 | * @param \Tight\Mvc\AbstractModel $model Model |
||
98 | * @return \Tight\Mvc\AbstractController Fluent setter |
||
99 | */ |
||
100 | public function setModel(AbstractModel $model) { |
||
104 | |||
105 | /** |
||
106 | * Event fired when the controller is instanciated |
||
107 | */ |
||
108 | abstract public function onLoad(); |
||
109 | |||
110 | abstract public function parseActions(); |
||
111 | |||
112 | /** |
||
113 | * Event fired before rendering the view |
||
114 | */ |
||
115 | abstract public function onRender(); |
||
116 | |||
117 | /** |
||
118 | * Event fired after rendering the view |
||
119 | */ |
||
120 | abstract public function onFinish(); |
||
121 | |||
122 | /** |
||
123 | * Renders the view |
||
124 | */ |
||
125 | public function render() { |
||
142 | |||
143 | } |
||
144 |