| 1 | <?php |
||
| 13 | class TemplateDispatcher implements DispatcherInterface |
||
| 14 | { |
||
| 15 | |||
| 16 | /** |
||
| 17 | * @var Route |
||
| 18 | */ |
||
| 19 | private $route; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * @var ResponseInterface |
||
| 23 | */ |
||
| 24 | private $response; |
||
| 25 | |||
| 26 | /** |
||
| 27 | * @var array |
||
| 28 | */ |
||
| 29 | protected $types = [ |
||
| 30 | 'json' => 'application/json', |
||
| 31 | 'xml' => 'application/xml', |
||
| 32 | 'txt' => 'text/plain', |
||
| 33 | 'html' => 'text/html' |
||
| 34 | ]; |
||
| 35 | |||
| 36 | /** |
||
| 37 | * @param Route $route |
||
| 38 | */ |
||
| 39 | public function __construct(Route $route,ResponseInterface $response) |
||
| 44 | |||
| 45 | /** |
||
| 46 | * @description call template file |
||
| 47 | */ |
||
| 48 | public function call() |
||
| 62 | |||
| 63 | /** |
||
| 64 | * @param $extension |
||
| 65 | */ |
||
| 66 | public function setContentType($extension){ |
||
| 72 | |||
| 73 | } |
||
| 74 |