To use Zend_Controller_Action, you will need to subclass it in your actual action controller classes (or subclass it to create your own base class for action controllers). The most basic operation is to subclass it, and create action methods that correspond to the various actions you wish the controller to handle for your site. Zend_Controller's routing and dispatch handling will autodiscover any methods ending in 'Action' in your class as potential controller actions.
By default, the front controller enables the ViewRenderer action helper. This helper takes care of injecting the view object into the controller, as well as automatically rendering views.While you can always override the action controller's constructor, we do not recommend this. Zend_Controller_Action::__construct() performs some important tasks, such as registering the request and response objects, as well as any custom invocation arguments passed in from the front controller. If you must override the constructor, be sure to call parent::__construct($request, $response, $invokeArgs).
The more appropriate way to customize instantiation is to use the init() method, which is called as the last task of __construct().
public function run(Zend_Controller_Request_Abstract $request = null, Zend_Controller_Response_Abstract $response = null)
{
if (null !== $request) {
$this->setRequest($request);
} else {
$request = $this->getRequest();
}
if (null !== $response) {
$this->setResponse($response);
}
$action = $request->getActionName();
if (empty($action)) {
$action = 'index';
}
$action = $action . 'Action';
$request->setDispatched(true);
$this->dispatch($action);
return $this->getResponse();
}