Another example for instance, I'll have to duplicate this across controllers

$this->db = Zend_Registry::get('db');
try {
           $this->db->getConnection();
       } catch (Zend_Db_Adapter_Exception $e) {
           var_dump($e);
// perhaps a failed login credential, or perhaps the RDBMS is not running
       } catch (Zend_Exception $e) {
           var_dump($e);
// perhaps factory() failed to load the specified Adapter class
       }



Jack Sleight wrote:
I solve this by creating an ApplicationController which extends Zend_Controller_Action, and then all my other controllers extend that. Just make sure to include the file, because ZF wont include it automatically.

Dan Rossi wrote:
Hi there I meant a common class the controllers can extend to reuse some functionality, ie getting the registries set in the bootstrap , etc. Then it means its only editable in one spot. Maybe via a plugin ?

Karol Grecki wrote:




Reply via email to