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

Route Question

Code Monkey

Well-known member
#1
I'm working at teaching myself how to mod Xenforo by converting a lot of my old game stat tools to Xenforo mods. I figured it's better to learn by converting code I already know. Anyway I was able to route the page like this.
Code:
http://mysite.com/that/
What I need to know is how to get it to route like this.

Code:
http://mysite.com/this/that/
Example code so far

PHP:
class MyMod_Route_Prefix_That implements XenForo_Route_Interface
{

    public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
    {
        //Please, discover what action the user wants to call!
        $action = $router->resolveActionWithStringParam($routePath, $request, 'MyMod', 'That');
        //Call the action in the controller SimpleText_ControllerPublic_SimpleText!
        return $router->getRouteMatch('MyMod_ControllerPublic_That', $action, 'MyMod', 'That');
    }

    public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
    {
        return XenForo_Link::buildBasicLinkWithStringParam($outputPrefix, $action, $extension, $data, 'That');
    }

}