1. 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?

Discussion in 'XenForo Development Discussions' started by Jaxel, Aug 23, 2011.

  1. Jaxel

    Jaxel 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?
  2. Jaxel

    Jaxel 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],

Share This Page