1. 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

Discussion in 'XenForo Development Discussions' started by ragtek, Jan 12, 2011.

  1. ragtek

    ragtek Guest

    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($routePathZend_Controller_Request_Http $requestXenForo_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($routePathZend_Controller_Request_Http $requestXenForo_Router $router)
        {
            
    $request->setParam('invitecode'basename($routePath));
            return 
    $router->getRouteMatch('XenForo_ControllerPublic_Register'$routePath);
        }
    }
    but that's also not working.

    Is this possible?
     
  2. ragtek

    ragtek Guest

    ok solved it

    The url had to be /?foo=bar
     
  3. Shadab

    Shadab Well-Known Member

    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
    ?
     
  4. ragtek

    ragtek Guest

    Maybe this was the problem...
    But nevermind, i'm using an other way for this.:)
     

Share This Page