Ok, I'm not sure if this is the right approach, but I think what you can do is something similar to below. Though please consider this means you will have to pick all your views, it won't do any of them automatically
In your Module.php file set-up your view to be a simple view
$di['view'] = function() {
$view = new \Phalcon\Mvc\View\Simple();
$view->setViewsDir(realpath(__DIR__.'../../../apps/'));
return $view;
};
Then in your bootstrap index.php disable automatic view rendering
$application->useImplicitView(false); // add this line
echo $application->handle()->getContent();
Finally in your action methods, you can do the following to pick your views
public function fooAction(){
echo $this->view->render('common/index');
echo $this->view->render('frontend/Views/layouts/index');
echo $this->view->render('frontend/Views/Index/foo');
}
No doubt with some thought you could build a plugin or a component that might handle this automatically, but this should achieve what you want (albeit you might have to rework more of your app)
In fact a basic example of the above would be doing something such as the following in a baseController
public function beforeExecuteRoute($dispatcher){
$module = $dispatcher->getModuleName();
$controller = $dispatcher->getControllerName();
$action = $dispatcher->getActionName();
$this->temp = $this->view->render('/'.$module.'/Views/'.$controller.'/'.$action);
}
and then in your action for your controller call
echo $this->temp; //temp set above
You would probably want to check that files exist in the baseController first but obviously you could append different views to $this->temp as well based on the $module/$controller etc.