Category : Zend

Zend Framework 1 – trace and log sql errors and exceptions

Zend Framework 1 – trace sql errors and exceptions and put them in a log file. Add the next code in the ErrorController.php: <?php class ErrorController extends Zend_Controller_Action { … public function errorAction() { … if (get_class($errors->exception) == ‘Zend_Db_Statement_Exception’) { $writer = new Zend_Log_Writer_Stream(“ADD HERE YOUR LOG PATH”); $logger = new Zend_Log($writer); $logger->info($errors->exception); } …

Read More →

Zend Framework – Setting the DocType

Specify the DocType $this->doctype(‘XHTML1_STRICT’); XHTML1_STRICT – XHTML 1.0 Strict XHTML1_TRANSITIONAL – XHTML 1.0 Transitional HTML4_STRICT – HTML 4.01 Strict HTML4_Loose – HTML 4.01 Loose HTML5 – HTML 5 Source: Zend Framework