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

Can you Reroute Controller POST to another Controller?

Discussion in 'XenForo Development Discussions' started by Uniphix, Sep 5, 2014.

  1. Uniphix

    Uniphix Active Member

    When a route is executed as a POST, ie for example register/register url structure. Question is can I reroute a controller Form POST to another controller. A good example of this is we have a way that our members can register through the registration process for a specific area, and paid for that area if they haven't registered yet. So therefore we want to make it so that registration process & payment process are done at the same time to reduce the amount of ping pong back and forth to different URL.

    So my idea was to have the registration process extended from the default using Event Code Listener. And there As soon as the registration method is finished rather than showing the view I was thinking that maybe the reroute method would allow me to continue more POST data there.

    Is this possible?
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member


    if ($this->_request->isPost())
    	return $this->responseReroute('XenForo_ControllerPublic_Thread', 'show-posts');
    This can be used inside of a controller action to reroute the response to a different controller and action.
    thedude likes this.

Share This Page