woodenlegacy
Member
Hey everyone, so im making a page that loads in stats for users, and everything works until you look something up without a /.
For example,
http://localhost/forums/stats/user <-- Doesn't work
http://localhost/forums/stats/user/ <-- Works
So how would I go about adding a trailing slash for links that dont have one?
Heres my route :
For example,
http://localhost/forums/stats/user <-- Doesn't work
http://localhost/forums/stats/user/ <-- Works
So how would I go about adding a trailing slash for links that dont have one?
Heres my route :
PHP:
public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
{
$action = $router->resolveActionWithStringParam($routePath, $request, 'username');
$action = $router->resolveActionAsPageNumber($action, $request);
$actions = explode('/', $action);
switch ($actions[0])
{
case 'search': $controller = 'Search'; break;
default: $controller = '';
}
return $router->getRouteMatch('bdStats_ControllerPublic_Stats', $controller, $action, 'stats');
}
public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
{
return XenForo_Link::buildBasicLinkWithStringParam($outputPrefix, $action, $extension, $data, 'username');
}