bundle/Templating/GlobalVariable.php
public function getCurrentMenuPlugin()
    {
        $currentRequest = $this->requestStack->getCurrentRequest();
        if (!$currentRequest instanceof Request) {
            return false;
        }

        foreach ($this->menuPluginRegistry->getMenuPlugins() as $identifier => $menuPlugin) {
            if ($menuPlugin->matches($currentRequest)) {
                return $identifier;
            }
        }

        return false;
    }
public function getCurrentMenuPlugin()
    {
        $currentRequest = $this->requestStack->getCurrentRequest();
        if (!$currentRequest instanceof Request) {
            return false;
        }

        foreach ($this->menuPluginRegistry->getMenuPlugins() as $identifier => $menuPlugin) {
            if ($menuPlugin->matches($currentRequest)) {
                return $identifier;
            }
        }

        return false;
    }
Returns the identifier of the current menu plugin.

@return string