Hello!

With the scope of having total control on what my actions return to the user i've implemented this method in my BaseController:

public function renderView($viewPath="", &$response=null) {
        $this->view->enable();
        if (!$response) {
            $response=$this->response;
        }

        $this->view->render($this->dispatcher->getControllerName(), $this->dispatcher->getActionName());
        $response->setContent($this->view->getContent());
        return $response;
    }

and in the action i use something like

return $this->renderView()

in my bootstrap file i've set

$application->useImplicitView(false);

The problem is that with this configuration, any action render the view twice. in the sense that in the browser i get 2 following blocks of <html> tags with all content...

but if i comment out

//$application->useImplicitView(false);

it works well again.

i've investigated the C code and with my very rusted knowledge i think that maybe there is some problem/bug when phalcon check if i've returned a Response object from the action. In this case it shouldn't render the view automatically, but when i set $application->useImplicitView(false); it skip this checking.

Could you confirm?