Route Prefix match method @returns

Earl

Well-known 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
https://xenforo.com/community/resources/jaxels-method-for-creating-a-route-controller.1637/

in the example at admincp
EQI8hmq.png



and in 2nd part of the example
EWRrio\Route\Streams.php

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:
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.
 
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.
Navigation Tabs = Breadcrumb?
Did you mean these tabs?
W6vok6v.png


If you mean these tabs, then is there any other way to create them without template hooks?
 
No, I mean these navigation tabs.
Screen Shot 2016-02-07 at 12.33.19 AM.webp

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.
 
No, I mean these navigation tabs.
View attachment 127990

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.
ahh! that one
Thanks for letting me know (y). appreciate the help
 
Top Bottom