# ActionStack

The ActionStack plugin allows you to manage a stack of requests, and operates as a postDispatch plugin. If a forward (i.e., a call to another action) is already detected in the current request object, it does nothing. However, if not, it checks its stack and pulls the topmost item off it and forwards to the action specified in that request. The stack is processed in LIFO order.

You can retrieve the plugin from the front controller at any time using `Zend_Controller_Front::getPlugin('Zend_Controller_Plugin_ActionStack')`. Once you have the plugin object, there are a variety of mechanisms you can use to manipulate it.

- `getRegistry()` and `setRegistry()`. Internally, ActionStack uses a `Zend_Registry` instance to store the stack. You can substitute a different registry instance or retrieve it with these accessors.

- `getRegistryKey()` and `setRegistryKey()`. These can be used to indicate which registry key to use when pulling the stack. Default value is '`Zend_Controller_Plugin_ActionStack`'.

- `getStack()` allows you to retrieve the stack of actions in its entirety.

- `pushStack()` and `popStack()` allow you to add to and pull from the stack, respectively. `pushStack()` accepts a request object.

An additional method, `forward()`, expects a request object, and sets the state of the current request object in the front controller to the state of the provided request object, and markes it as undispatched (forcing another iteration of the dispatch loop).