views:

66

answers:

2

I am using Zend Framework. I want to create a class that handle log messages, for that purpose i used Zend_Form. But i m facing difficulties in creating the class.

I want to use it to enter log messages as well as to view log messages.

A: 

To enter log messages extend Zend_Form and in init() method insert some elements of your choice. After form posting use Zend_Log with Writer of your choice. There is no class that is pre-made for viewing log messages. Just output HTML or format of your choice (json, xml, etc)

Tomáš Fejfar
A: 

I would probably create a Model_Log class - for your log objects - and Model_LogTable class - for querying the DB. The Model_Log class would extend Zend_Db_Table_RowAbstract (I believe) and Model_LogTable would extend Zend_Db_TableAbtract. This gives you a structure to your objects as well as an easy way to interact with that table (assuming you're writing your own log table).

The form gives you your CRUD but you'll still need a controller for paginating your list. I wouldn't generally extend Zend_Form unless I needed something very specific for my forms. Your objects probably wouldn't fall into that category.

Inkspeak
Wow, I didn't realize how old this thread was. Man, pay attention.
Inkspeak