| 1 | <?php | ||
| 11 | class TemplateDispatcher implements DispatcherInterface | ||
| 12 | { | ||
| 13 | |||
| 14 | /** | ||
| 15 | * @var Router | ||
| 16 | */ | ||
| 17 | private $router; | ||
| 18 | |||
| 19 | /** | ||
| 20 | * @var array | ||
| 21 | */ | ||
| 22 | protected $types = [ | ||
| 23 | 'json' => 'application/json', | ||
| 24 | 'xml' => 'application/xml', | ||
| 25 | 'txt' => 'text/plain', | ||
| 26 | 'html' => 'text/html' | ||
| 27 | ]; | ||
| 28 | |||
| 29 | /** | ||
| 30 | * @param Router $router | ||
| 31 | */ | ||
| 32 | public function __construct(Router $router) | ||
| 36 | |||
| 37 | /** | ||
| 38 | * @description call template file | ||
| 39 | */ | ||
| 40 | public function call() | ||
| 53 | |||
| 54 | /** | ||
| 55 | * @param $extension | ||
| 56 | */ | ||
| 57 | public function setContentType($extension) | ||
| 63 | |||
| 64 | } | ||
| 65 |