需求:能够动态地建立表单Symfony的1.4形式创世
结构(简单的想法,而不是实际的结构)
Admin: Form Assignment, where you create what field you want your new Form to have
FrontEnd: Where the New form will be implemented (this is the root of this question)
FronEnd Storage: When the New form is filled out the data points are written to a set of tables
的想法很简单,走进管理员,选择字段,字段类型,并你想要的标签
IE
Field Name:*Enter a specific field name, like f_name or email
FieldType: [Text, TextArea, Password, Radio, DatePicker, CheckBox, Select, etc]
Label: What to display on the resulting form, f_name = First Name, etc
然后我打在产生新的形式,我填好瞧的数据存储在前端存储表前端的页面。
所以现在的问题是,想法是如何做到这一点,我已经有了管理部分完成的,它是动态建立和适当地结合一个前端,从我想上的建议。
目前我的想法是简单地做一个壳形式是建立sfForm元素和适当的验证为每个字段(从什么是在管理区域中输入给定的字段)
我觉得这是一个巨大的丑陋的switch语句是做错的方法,我确实找到了一个插件'spyFormBuilderInterface2Plugin',它是旧的,并且构建为propel而不是教条,但这是我所追求的基本概念。那么你会怎么做呢?
请注意,我不是在寻找动态添加表格到目前的形式,我已经可以做到这一点,这也正是我的管理部分实现,我需要的数据创建了一个全新的形式编程