• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Get the route path of the current page?


Well-known member
I am trying to make some navtab changes... so in my navtab listener, I need to check what route path the user is currently on. How do I get this information?


Well-known member
For now, I did this... but there has to be a better way.

class EWRmedio_Listener_NavTabs
    public static function listen(array &$extraTabs, $selectedTabId)
        $permsModel = XenForo_Model::create('EWRmedio_Model_Perms');
        $perms = $permsModel->getPermissions();

        $request = new Zend_Controller_Request_Http;
        $request = $request->get('REQUEST_URI');
        $request = explode('/', $request);

        $extraTabs['media'] = array(
            'title' => new XenForo_Phrase('media'),
            'href' => XenForo_Link::buildPublicLink('full:media'),
            'position' => 'middle',
            'linksTemplate' => 'EWRmedio_Navtabs',
            'perms' => $perms,
            'route' => $request[1],