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

Add more params to the register url

R

ragtek

Guest
#1
Hi, i'm working on my invite Add-on.

The add-on sends a mail to the invited user with a register link.

Now i need a extraparam for this=> invitecode = $foo

I'm not sure how i can implement this.
The router doesn't accept params.
PHP:
public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
	{
		return $router->getRouteMatch('XenForo_ControllerPublic_Register', $routePath);
	}
and if i make something like: http://localhost/xf/upload/register/register/invitecode/daniel
i'm getting an error that the action The controller XenForo_ControllerPublic_Register does not define an action called RegisterInvitecodeDaniel. doesn't exist.

I tried to overwrite the register router:
PHP:
class Ragtek_Invite_Route_Prefix_Register implements XenForo_Route_Interface{
    public function match($routePath, Zend_Controller_Request_Http $request, XenForo_Router $router)
    {
        $request->setParam('invitecode', basename($routePath));
        return $router->getRouteMatch('XenForo_ControllerPublic_Register', $routePath);
    }
}
but that's also not working.

Is this possible?
 

Shadab

Well-known member
#3
Since you are extending a core route prefix class, shouldn't that be:
PHP:
class Ragtek_Invite_Route_Prefix_Register extends XFCP_Ragtek_Invite_Route_Prefix_Register
?
 
R

ragtek

Guest
#4
Since you are extending a core route prefix class, shouldn't that be:
PHP:
class Ragtek_Invite_Route_Prefix_Register extends XFCP_Ragtek_Invite_Route_Prefix_Register
?
Maybe this was the problem...
But nevermind, i'm using an other way for this.:)