views:

177

answers:

1

I have a plugin in my Zend Framework application that checks login status after every request, and reroutes the user to the login action if their session is invalid or expired. I would like to cache the previous request action so that, after a successful login attempt, I can redirect them back to their previous request.

I have found the documentation on the setActionController() method, but I can't find anything on a "getActionController()" method. Does one exist? If so, does anyone have any information they could link me to on it? If not, what's the best way to achieve my goal?

+6  A: 

In the default routing, both the controller and the action are always passed along with the request.

$controller = $this->getRequest()->getControllerName();
$action = $this->getRequest()->getActionName();
nuqqsa
Dang, I think I even knew that somewhere in the back of my lizard brain. Thanks!
Daniel Ingraham