// Controller
public function indexAction()
{
echo $this->view->getViewsDir().$this->dispatcher->getControllerName().'/'.$this->dispatcher->getActionName();
die;
}
Thank you. But what if I $this->view->pick() another template from the action ? What I'm tried to get is really which file is being rendered regardless of what's the current controller/action.
You can use the beforeRenderView event to retrieve the path of the view that's being rendered.
Inside that same event handler you can then pass the path as a view variable:
E.g:
$eventsManager->attach('view:beforeRenderView', function ($event, $view, $path) {
$view->setVar('activeRenderPath', $path);
});