public function getCurrentTemplateName()
    {
        if (!($currentTemplate = basename((string) Registry::getRequest()->getRequestEscapedParameter('tpl')))) {
            // in case template was not defined in request
            $currentTemplate = Registry::getConfig()->getActiveView()->getTemplateName();
        }

        return $currentTemplate;
    }