Exemplo n.º 1
0
 public function dispatch()
 {
     $route = $this->router->findRoute($this->request);
     $this->request->setRoute($route);
     try {
         $responseDTO = $this->handleRequest($route);
         $viewModel = $this->translateResponseData($responseDTO);
         $this->response->setViewModel($viewModel);
         $this->response->send();
     } catch (RequestHandlingException $exception) {
         // handle exception
     } catch (ResponseHandlingException $exception) {
         // handle exception
     }
 }