0
下面這個函數在Bootstrap
類中用於在DB中添加log
以用於errors.Now我必須使用Flashmessenger和Redirector helpers將它重定向到Dashboard。但它會引發致命錯誤。Zend引導重定向
protected function _initDebug()
{
register_shutdown_function(function() {
if ($e = error_get_last()) {
Zend_Registry::get('logger')->emerg($e['message'] . " in " . $e['file'] . ' line ' . $e['line'], 'error');
$logsDbTable = new Application_Model_DbTable_Logs();
$id = $logsDbTable->getLastInsertId();
$message = sprintf(Zend_Registry::getInstance()->config->ticket_msg,$id,Zend_Registry::getInstance()->config->support_phone_number);
$this->_helper->FlashMessenger(array('error' => $message));
$this->_helper->_redirector->goToSimple('index', 'dashboard');
}
});
}
是$ this - > _ helper可用於引導類嗎?你註冊了Zend_Controller_Action_HelperBroker嗎? –
不,我還沒有註冊@ARIFMAHMUDRANA –