Triggering a reroute from controller_pre_dispatch?

Jake B.

Well-known member
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
 
I've tried this already:

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

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

That would work, what do you want it to do?

Liam
 
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
 
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.
 
Back
Top Bottom