2009年6月4日星期四

Re: [fw-mvc] Pattern / example?

In the discussion we had yesterday at work - we thought it would be
neat if you could pass a model to Zend_Form and have it automatically
build the form based on database field meta data with the option to
override this with definitions within the form itself. Use input
fields for varchar, textareas for text fields, checkboxes for boolean
fields, etc..

> But there is a tiny problem .All the elements must be classified
> to Zend_Form_Element_(*).
> Zend_Form_Element_(*) is classfied as view logic to perform
>  specifically in HTML form elements.  Not meta model.
> What type of Zend_Form_Element_(*) should I use ?
> Should I change the class according to the rendering situation?
> In reality, I selected Zend_Form_Element_Textarea and
> changed decorators per situation.

没有评论: