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

Route Prefix match method @returns

Discussion in 'XenForo Development Discussions' started by Earl, Feb 6, 2016.

  1. Earl

    Earl Member

    i checked in the Xenforo core code in match method of "XenForo_Route_Prefix_Members" class has
    return $router->getRouteMatch('XenForo_ControllerPublic_Member', $action, 'members');

    but XenForo_Route_Prefix_Attachments doesn't have "attachments" in it.
    return $router->getRouteMatch('XenForo_ControllerPublic_Attachment', $action);

    And i found a guide but there is a small problem
    this is directly from @Jaxel 's tutorial

    in the example at admincp

    and in 2nd part of the example

    public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
    $action = $router->resolveActionWithStringParam($routePath, $request, 'string_id');
    $action = $router->resolveActionWithIntegerParam($routePath, $request, 'action_id');
    $action = $router->resolveActionAsPageNumber($action, $request);
    return $router->getRouteMatch('EWRrio_ControllerPublic_Streams', $action, 'streams');

    according to 1st part of the tutorial the "streams" is the major route, but in the 2nd part "streams" appear after the $action. why appear in two places?
    Last edited: Feb 6, 2016
  2. Daniel Hood

    Daniel Hood Well-Known Member

    That parameter is used to select which navigation tab should be selected. Attachments don't display the full site so there's no reason to specify a tab.
    Earl likes this.
  3. Earl

    Earl Member

    Navigation Tabs = Breadcrumb?
    Did you mean these tabs? [​IMG]

    If you mean these tabs, then is there any other way to create them without template hooks?
  4. Daniel Hood

    Daniel Hood Well-Known Member

    No, I mean these navigation tabs.
    Screen Shot 2016-02-07 at 12.33.19 AM.png

    You create them via a code event listener (navigation_tabs). You assign yours an identifier in the listener (the php part, not the code event listener page on the admin panel). Then your route uses that identifier to tell the system that's the active tab. It actually adds it to the breadcrumb that you were asking about as well.
    Earl likes this.
  5. Earl

    Earl Member

    ahh! that one
    Thanks for letting me know (y). appreciate the help

Share This Page