Tuesday, November 11, 2008
Forms in ZF
This Artikle really discripes the use of forms: http://devzone.zend.com/article/3450-Decorators-with-Zend_Form
Monday, October 27, 2008
How to use Zend_Log
Setup the logger in the Bootstrap file:
Using the logger:
Log an exception:
Log a message:
//initiate the logger - Log to a file
$writer = new Zend_Log_Writer_Stream($root.'\log\test.txt');
$logger = new Zend_Log($writer);
//Log to Database.
$columnMap = array('lvl' => 'priority', 'msg' => 'message', 'timestamp' => 'timestamp', 'lvlName' => 'priorityName');
$dbwriter = new Zend_Log_Writer_Db($db, 'log_table_name', $columnMap);
$logger->addWriter($dbwriter);
//Log to firebug
$writerFirebug = new Zend_Log_Writer_Firebug();
$writerFirebug->setPriorityStyle(6, 'TRACE');
$logger->addWriter($writerFirebug);
$registry->logger = $logger;
Using the logger:
$logger = Zend_Registry::get('logger');
Log an exception:
$exception = new Zend_Exception('Test exception');
$logger->err($exception);
Log a message:
$logger->info('Show Information about something');
Subscribe to:
Posts (Atom)