Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I get the current action in Zend Framework?

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?

like image 875
Daniel Ingraham Avatar asked May 06 '10 20:05

Daniel Ingraham


People also ask

How does Zend Framework work?

Zend Framework is a collection of professional PHP packages with more than 570 million installations. It can be used to develop web applications and services using PHP 5.6+, and provides 100% object-oriented code using a broad spectrum of language features.


1 Answers

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(); 
like image 172
nuqqsa Avatar answered Sep 24 '22 13:09

nuqqsa