> 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.
Thank you for your comment. I didn't think of it as that *automatically*.
But off the top my head, I usually get a model from bootstrap's
pluginResource provided by Zend_Application.
I will do it on if there is no config to the form but only tablename,
a factory at the bootstrap will make a config of fields from model
$info = $table->info();$info['metadata'];
And if the config has a customized flag. no update fields.
thanks
--
Tomoaki Kosugi
id:noopable
2009/6/4 Ed Lazor <edlazor@internetarchitects.biz>:
> 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.
>
没有评论:
发表评论