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(). For example, if you want to connect to
a database at instantiation:
<?php
class FooController extends Zend_Controller_Action
{
public function init()
{
$this->db = Zend_Db::factory('Pdo_Mysql', array(
'host' => 'myhost',
'username' => 'user',
'password' => 'XXXXXXX',
'dbname' => 'website'
));
}
}




