Dan
I think that's little excessive. Why do you call getConnection() explicitly?
What do you do inside each catch{} block?
Unless you have some smart way to handle such failure it's absolutely
pointless in my opinion.
Karol
Dan Rossi-5 wrote:
>
> 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:
>>>
>>>
>>
>
>
>
--
View this message in context:
http://www.nabble.com/project-baseclass-for-all-controllers-tf4203756s16154.html#a11962555
Sent from the Zend Framework mailing list archive at Nabble.com.