Nick Lo wrote:
>
> Anyway, I finally narrowed it down...
>
> Before I was first extending Zend_Controller_Action with a general file
> something like:
>
> class IndexController extends Zend_Controller_Action
> {
> public function __construct()
> {
> parent::__construct();
> do general stuff like get common objects from the registry
> }
> }
>
> ...then using that for more specific controller files...
>
> class ArticlesController extends IndexController
> {
> public function __construct()
> {
> parent::__construct();
> do articles specific stuff like get Zend_Db_Table stuff
> }
> }
Nowadays, you should override Zend_Controller_Action::init() rather than
override the constructor. Zend_Controller_Action::__construct() calls
init() as the last thing it does.
Alternatively, you could override Zend_Controller_Action::preDispatch()
which gets called directly before each Action function.
Regards,
Rob...