1 | <?php |
||
36 | abstract class AbstractController |
||
37 | { |
||
38 | |||
39 | /** |
||
40 | * @var \Tight\Mvc\AbstractView |
||
41 | */ |
||
42 | private $view; |
||
43 | |||
44 | /** |
||
45 | * @var \Tight\Mvc\AbstractModel |
||
46 | */ |
||
47 | private $model; |
||
48 | |||
49 | public function __construct(AbstractModel $model, AbstractView $view) { |
||
54 | |||
55 | /** |
||
56 | * Gets the view |
||
57 | * @return \Tight\Mvc\AbstractView |
||
58 | */ |
||
59 | public function getView() { |
||
62 | |||
63 | /** |
||
64 | * Gets the model |
||
65 | * @return \Tight\Mvc\AbstractModel |
||
66 | */ |
||
67 | public function getModel() { |
||
70 | |||
71 | /** |
||
72 | * Sets the view |
||
73 | * @param \Tight\Mvc\AbstractView $view View |
||
74 | * @return \Tight\Mvc\AbstractController Fluent setter |
||
75 | */ |
||
76 | public function setView(AbstractView $view) { |
||
80 | |||
81 | /** |
||
82 | * Sets the model |
||
83 | * @param \Tight\Mvc\AbstractModel $model Model |
||
84 | * @return \Tight\Mvc\AbstractController Fluent setter |
||
85 | */ |
||
86 | public function setModel(AbstractModel $model) { |
||
90 | |||
91 | /** |
||
92 | * Event fired when the controller is instanciated |
||
93 | */ |
||
94 | abstract public function onLoad(); |
||
95 | |||
96 | /** |
||
97 | * Event fired before rendering the view |
||
98 | */ |
||
99 | abstract public function onRender(); |
||
100 | |||
101 | /** |
||
102 | * Event fired after rendering the view |
||
103 | */ |
||
104 | abstract public function onFinish(); |
||
105 | |||
106 | /** |
||
107 | * Renders the view |
||
108 | */ |
||
109 | public function render() { |
||
122 | |||
123 | } |
||
124 |