Teapot
Well-known member
Quick routing question. I'm trying to make my route's string parameters, which are content tags and therefore are short strings that allow spaces, produce URLs that are more consistent with the string plus integer URLs. Right now, any spaces in tags are escaped as %20, not a dash as usual - so instead of:
/tags/cheese-for-everybody
I'm getting: /tags/cheese%20for%20everybody
Anyone know how to do this in the route controller? Right now it's a very generic one and looks like this:
/tags/cheese-for-everybody
I'm getting: /tags/cheese%20for%20everybody
Anyone know how to do this in the route controller? Right now it's a very generic one and looks like this:
PHP:
<?php
class Teapot_HashBrown_Route_Tag implements XenForo_Route_Interface
{
public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
{
$action = $router->resolveActionWithStringParam($routePath, $request, 'name');
return $router->getRouteMatch('Teapot_HashBrown_ControllerPublic_Tag', $action, 'tags');
}
public function buildLink($originalPrefix, $outputPrefix, $action, $extension, $data, array &$extraParams)
{
return XenForo_Link::buildBasicLinkWithStringParam($outputPrefix, $action, $extension, $data, 'name');
}
}
Last edited: