In Zend Framework 2, I am trying to get the path of the current view template in a custom view helper.
If I have a view helper called "testThis" and I am rendering a template located at view/inside/bar/baz.phtml then I want to be able to get this path from within the "testThis" __invoke method.
This should always get the calling view though - for example if inside this baz.phtml file I use the partial helper to load another template called boo.phtml, then if I called "testThis" from within this boo.phtml template I would get that path instead of the baz.phtml.
Is this possible and if so, how to do it?
Edit: If I add a function to Zend\View\Renderer\PhpRenderer that returns the private variable $__template then I get exactly what I need but it would be nice to not have to modify the framework - is there a way to get it without adding this function?