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

Route Question

Discussion in 'XenForo Development Discussions' started by Code Monkey, May 1, 2015.

  1. Code Monkey

    Code Monkey Well-Known Member

    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($routePathZend_Controller_Request_Http $requestXenForo_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');
        }

    }
     

Share This Page