src/Web/Servlet/DispatcherServlet.php
protected function render(ModelAndView $mv, Request $request, Response $response)
    {
        $view = null;
        if ($mv->isReference()) {
            $view = resolveViewName($mv->getViewName(), $mv->getModelMap(), null, $request);
            if ($view == null) {
                throw new \Exception("Could not resolve view with name '".$mv->getViewName()."'.");
            }
        } else {
            $view = $mv->getView();
            if ($view == null) {
                throw new \Exception("ModelAndView neither contains a view name nor a View object.");
            }
        }
        try {
            $view->render($mv->getModelMap(), $request, $response);
        } catch (\Exception $ex) {
            $this->logger->debug("Error rendering view.");
            throw $ex;
        }
    }
protected function render(ModelAndView $mv, Request $request, Response $response)
    {
        $view = null;
        if ($mv->isReference()) {
            $view = resolveViewName($mv->getViewName(), $mv->getModelMap(), null, $request);
            if ($view == null) {
                throw new \Exception("Could not resolve view with name '".$mv->getViewName()."'.");
            }
        } else {
            $view = $mv->getView();
            if ($view == null) {
                throw new \Exception("ModelAndView neither contains a view name nor a View object.");
            }
        }
        try {
            $view->render($mv->getModelMap(), $request, $response);
        } catch (\Exception $ex) {
            $this->logger->debug("Error rendering view.");
            throw $ex;
        }
    }
protected function render ( ModelAndView $ mv , Request $ request , Response $ response ) { $ view = null ; if ( $ mv -> isReference ( ) ) { $ view = resolveViewName ( $ mv -> getViewName ( ) , $ mv -> getModelMap ( ) , null , $ request ) ; if ( $ view == null ) { throw new \ Exception ( "Could not resolve view with name '" . $ mv -> getViewName ( ) . "'." ) ; } } else { $ view = $ mv -> getView ( ) ; if ( $ view == null ) { throw new \ Exception ( "ModelAndView neither contains a view name nor a View object." ) ; } } try { $ view -> render ( $ mv -> getModelMap ( ) , $ request , $ response ) ; } catch ( \ Exception $ ex ) { $ this -> logger -> debug ( "Error rendering view." ) ; throw $ ex ; } }
Render the given ModelAndView.
@param ModelAndView $mv       the ModelAndView to render
@param Request      $request  current HTTP servlet request
@param Response     $response current HTTP servlet response
@throws \Exception if there's a problem rendering the view
@return void
Render the given ModelAndView .