1 | <?php |
||
22 | class MainController |
||
23 | { |
||
24 | /** |
||
25 | * @var Router |
||
26 | */ |
||
27 | private $router; |
||
28 | |||
29 | /** |
||
30 | * @var Response |
||
31 | */ |
||
32 | private $response; |
||
33 | |||
34 | /** |
||
35 | * @var RestUtilsInterface |
||
36 | */ |
||
37 | private $restUtils; |
||
38 | |||
39 | /** |
||
40 | * @var EngineInterface |
||
41 | */ |
||
42 | private $templating; |
||
43 | |||
44 | /** |
||
45 | * @var array |
||
46 | */ |
||
47 | private $addditionalRoutes; |
||
48 | |||
49 | /** |
||
50 | * @var array |
||
51 | */ |
||
52 | private $pathWhitelist; |
||
53 | |||
54 | /** |
||
55 | * @param Router $router router |
||
56 | * @param Response $response prepared response |
||
57 | * @param RestUtilsInterface $restUtils rest-utils from GravitonRestBundle |
||
58 | * @param EngineInterface $templating templating-engine |
||
59 | * @param array $additionalRoutes custom routes |
||
60 | * @param array $pathWhitelist serviec path that always get aded to the main page |
||
61 | * |
||
62 | */ |
||
63 | 7 | public function __construct( |
|
78 | |||
79 | /** |
||
80 | * create simple start page. |
||
81 | * |
||
82 | * @return Response $response Response with result or error |
||
83 | */ |
||
84 | 4 | public function indexAction() |
|
108 | |||
109 | /** |
||
110 | * Determines what service endpoints are available. |
||
111 | * |
||
112 | * @param array $optionRoutes List of routing options. |
||
113 | * |
||
114 | * @return array |
||
115 | */ |
||
116 | 5 | protected function determineServices(array $optionRoutes) |
|
150 | |||
151 | /** |
||
152 | * Prepares the header field containing information about pagination. |
||
153 | * |
||
154 | * @return string |
||
155 | */ |
||
156 | 5 | protected function prepareLinkHeader() |
|
171 | |||
172 | /** |
||
173 | * tells if a service is relevant for the mainpage |
||
174 | * |
||
175 | * @param array $val value of service spec |
||
176 | * |
||
177 | * @return boolean |
||
178 | */ |
||
179 | 5 | private function isRelevantForMainPage($val) |
|
184 | |||
185 | /** |
||
186 | * Renders a view. |
||
187 | * |
||
188 | * @param string $view The view name |
||
189 | * @param array $parameters An array of parameters to pass to the view |
||
190 | * @param Response $response A response instance |
||
191 | * |
||
192 | * @return Response A Response instance |
||
193 | */ |
||
194 | 4 | public function render($view, array $parameters = array(), Response $response = null) |
|
198 | } |
||
199 |