1 | <?php |
||
7 | final class Controller |
||
8 | { |
||
9 | /** |
||
10 | * Controller constructor. |
||
11 | * |
||
12 | * Set context and fetch post id |
||
13 | */ |
||
14 | function __construct() |
||
18 | |||
19 | /** |
||
20 | * make singleton |
||
21 | * |
||
22 | * @return null|Controller |
||
23 | */ |
||
24 | public static function Instance() |
||
33 | |||
34 | /** |
||
35 | * Set all pages from within the functions.php->setControllers() |
||
36 | * |
||
37 | * @param $pages |
||
38 | */ |
||
39 | public function setPages($pages) |
||
43 | |||
44 | /** |
||
45 | * Set context for the page |
||
46 | */ |
||
47 | private function setContext() |
||
53 | |||
54 | private function returnId($key) |
||
62 | |||
63 | public function page() |
||
94 | |||
95 | /** |
||
96 | * Fallback when no controller found or controller file isn't present |
||
97 | */ |
||
98 | private function returnDefault() |
||
104 | |||
105 | /** |
||
106 | * Return name of the body class |
||
107 | * |
||
108 | * @return bool|string |
||
109 | */ |
||
110 | public function getClass() |
||
118 | } |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.