简体   繁体   English

Zend Framework:表单:如何创建极其自定义的元素

[英]Zend Framework: Form: How do I create a extremely custom element(s)

I will start by saying that I am familiar with Zend Form, and its options/decorators etc, I am looking for some guidance on how best to execute this type of form, also the system uses jQuery, and jQuery-UI so, we can use them too, I should also mention that I do not require advice of the model, ie how to save the info, I need help with rendering this type of form, I suspect I will need to use view helpers, and cusom form elements? 首先,我要熟悉Zend Form及其选项/修饰符等,我正在寻找一些有关如何最好地执行这种形式的表单的指南,而且系统使用jQuery和jQuery-UI,因此,我们可以也使用它们,我还应该提到我不需要模型的建议,即如何保存信息,我需要呈现这种类型的表单的帮助,我怀疑我将需要使用视图助手和cusom表单元素?

The problem: 问题:

My app has a page which links "products" to a "customer". 我的应用程序有一个页面,该页面将“产品”链接到“客户”。 "products" have a default price, but this can be overridden per customer, this needs to be factored in, I must be able to select from the list of standard products which ones the customer has purchased, override its default price, as well as add any number of custom products on the fly, as such: “产品”具有默认价格,但是每个客户都可以覆盖此默认价格,因此需要考虑这一点。我必须能够从标准产品列表中选择客户购买的产品,覆盖其默认价格以及快速添加任意数量的定制产品,例如:

The Form: 表格:

Customer: John Doe 客户:John Doe

Products (X are selected to be linked to customer): 产品 (选择X以链接到客户):

[ ] Blah Product/Service [$32.00] [] Blah产品/服务[$ 32.00]

[X] Foo Service [$23.45] [X] Foo服务[$ 23.45]

Additional products/services (inputs): 其他产品/服务 (输入):

Product Name: [Input] Cost ($): [input] Description: [Input] 产品名称:[输入]成本($):[输入]说明:[输入]

Add service: [Button] <-- Possibly "update the form to add a new set of (above) inputs" 添加服务:[按钮] <-可能是“更新表单以添加一组新的(上方)输入”

Save customer record: [Button] 保存客户记录:[按钮]

Thanks for your help guys, Jay 谢谢您的帮助,杰伊

Doesn't seem to me that this form is going to be as custom as you might think. 在我看来,这种形式不会像您想象的那样习惯。

The trick is in the dynamic addition of products on the fly. 诀窍在于动态添加产品。 Towards that end, see Jeremy Kendall's excellent post on the subject: 为此,请参见Jeremy Kendall关于该主题的出色文章:

Dynamically Adding Elements to Zend_Form 动态向Zend_Form添加元素

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何向Zend \\ Form \\ View \\ Helper \\ FormElement的typemap添加自定义Form元素助手? - How do I add a custom Form element helper to Zend\Form\View\Helper\FormElement's typemap? 如何在表单中创建数组元素-Zend Framework 2 - how to create an array element in form - zend framework 2 Zend Framework,Zend_Form_Element如何设置自定义名称? - Zend Framework, Zend_Form_Element how to set custom name? Zend Framework:设置一个Zend_Form_Element表单字段是必需的,如何更改用于确保元素不为空的验证器 - Zend Framework: setting a Zend_Form_Element form field to be required, how do I change the validator used to ensure that the element is not blank 如何在zend框架中添加自定义表单元素fckeditor - How to add custom form element fckeditor in zend framework Zend Framework 1&gt;确定,我编写了一个自定义验证器。 我放在哪里? 我的Zend_Form如何包含它? - Zend Framework 1 > OK, I've written a custom validator. Where do I put it? How does my Zend_Form include it? Zend Framework / Form Elements:创建自定义类还是? - Zend Framework/Form Elements: Create custom class or? 如何在Zend Framework 1中将自定义视图帮助器用于表单? - How I can use custom view helper for form in Zend Framework 1? 我如何在zend Framework 2中的表单内使用视图助手? - How do I use a view helper inside a form in zend framework 2? 如何在Zend Framework 1.12中呈现表单元素数组? - How do I render an array of form elements in Zend Framework 1.12?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM