1 | <?php |
||
26 | class Renderer extends AbstractMiddleware implements MiddlewareInterface |
||
27 | { |
||
28 | |||
29 | /** |
||
30 | * @var ServerRequestInterface |
||
31 | */ |
||
32 | protected $request; |
||
33 | |||
34 | /** |
||
35 | * Handles a Request and updated the response |
||
36 | * |
||
37 | * @param ServerRequestInterface $request |
||
38 | * @param ResponseInterface $response |
||
39 | * |
||
40 | * @return ResponseInterface |
||
41 | */ |
||
42 | public function handle( |
||
53 | |||
54 | /** |
||
55 | * Adds a template path |
||
56 | * |
||
57 | * @param $path |
||
58 | */ |
||
59 | public function addTemplatePath($path) |
||
63 | |||
64 | /** |
||
65 | * Processes and renders the response |
||
66 | * |
||
67 | * @param ResponseInterface $response |
||
68 | * @return ResponseInterface|static |
||
69 | */ |
||
70 | protected function render(ResponseInterface $response) |
||
80 | |||
81 | /** |
||
82 | * Creates the engine for this rendering |
||
83 | * |
||
84 | * @return \Slick\Template\TemplateEngineInterface |
||
85 | */ |
||
86 | protected function getEngine() |
||
91 | |||
92 | /** |
||
93 | * Gets the template file for current request |
||
94 | * |
||
95 | * @return string |
||
96 | */ |
||
97 | protected function getTemplate() |
||
103 | |||
104 | /** |
||
105 | * Gets data to be processed |
||
106 | * |
||
107 | * @return array |
||
108 | */ |
||
109 | protected function getData() |
||
114 | |||
115 | /** |
||
116 | * Returns the default template from current request route |
||
117 | * |
||
118 | * @return string |
||
119 | */ |
||
120 | protected function getDefaultTemplate() |
||
127 | } |