Build a simple route like addon/get-pure-string-param

  • Thread starter Thread starter account8226
  • Start date Start date
A

account8226

Guest
Hello,

I have always build complex URLs in my addons, like addon-name/action/name.id.

But I never tried to do something simple.
I would like, to have an addon with the following routes :
Code:
board-url/addon/string-param

Actually, I was using the following code, but it's resolving the second param as an action, and not a simple get input.

PHP:
public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
    {
        $action = $router->resolveActionWithStringParam($routePath, $request, 'name');
        return $router->getRouteMatch('A_ControllerPublic_Index', $action);
    }

Any ideas ?

Best regards.
 
PHP:
public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
    {
        return $router->getRouteMatch('Addon_ControllerPublic_Addon', $routePath);
    }
Example in Addon_ControllerPublic_Addon you call actionAwesome so in URL should be {boardUrl}/{AddonPrefix}/Awesome
You can view: XenForo_ControllerPublic_Misc for more information ;)
 
Back
Top Bottom