开发者

Can I add multiple elements in a single DD of Zend Form

开发者 https://www.devze.com 2023-03-09 13:36 出处:网络
I am working on php and now trying to learning Zend, I am trying to collect the age (Year/month) using zend_form. So I want开发者_运维问答 to put 2 text boxes in thesame DD wrapper.

I am working on php and now trying to learning Zend, I am trying to collect the age (Year/month) using zend_form. So I want开发者_运维问答 to put 2 text boxes in the same DD wrapper.

Can any one help me please.

Thank you


You could create a composite form element that comprises your two text fields. Then create custom decorator for that element to handle the aggregation. Then add the standard DtDd wrapper.

See this post by MWOP for an example: Creating composite elements


You can't place many input boxes in single element's decorator (with some exceptions like radioboxes or multicheckboxes). Instead that, you must to remove decorator Zend_Form_Decorator_DtDdWrapper from both elements and place them in new Zend_Form_DisplayGroup. Then You can set Zend_Form_Decorator_DtDdWrapper to that DisplayGroup

0

精彩评论

暂无评论...
验证码 换一张
取 消