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

Triggering a reroute from controller_pre_dispatch?

Jake B.

Well-known member
#1
In controller_pre_dispatch XenForo_Controller is made available, but I can't seem to find anything that will let me trigger a responseReroute. I can't do a return from this code event listener, so I'm not entirely sure if this is possible. Any assistance would be great :D
 

Jake B.

Well-known member
#2
I've tried this already:

Code:
throw $controller->responseException(
$controller->responseReroute('ControllerClass', 'action')
);
but it doesn't seem to do what I want :S
 

Liam W

Well-known member
#6
It doesn't seem to be doing anything, I'm just wanting it to reroute.
A couple of things...

Are you sure the listener is being called (check for the hint & any if statements).

I've used the same system before, and it worked for me...

Liam
 

Jake B.

Well-known member
#7
A couple of things...

Are you sure the listener is being called (check for the hint & any if statements).

I've used the same system before, and it worked for me...

Liam
Yeah, i've found the issue. Apparently at some point during my testing I threw a return into XenForo_Controller::preDispatch just before the XenForo_CodeEvent::fire and forgot to remove it. Seems to be working now.