Conditions | 1 |
Paths | 1 |
Total Lines | 16 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
23 | public function renderPage($data, $status = 200) |
||
24 | { |
||
25 | $data["stylesheets"] = ["css/style.css"]; |
||
26 | |||
27 | // Add common header, navbar and footer |
||
28 | //$this->view->add("default1/header", [], "header"); |
||
29 | //$this->view->add("default1/navbar", [], "navbar"); |
||
30 | //$this->view->add("default1/footer", [], "footer"); |
||
31 | |||
32 | // Add layout, render it, add to response and send. |
||
33 | $this->view->add("default1/layout", $data, "layout"); |
||
34 | $body = $this->view->renderBuffered("layout"); |
||
35 | $this->response->setBody($body) |
||
36 | ->send($status); |
||
37 | exit; |
||
38 | } |
||
39 | } |
||
40 |
In PHP it is possible to write to properties without declaring them. For example, the following is perfectly valid PHP code:
Generally, it is a good practice to explictly declare properties to avoid accidental typos and provide IDE auto-completion: