简体   繁体   中英

Adding fields dynamically to a form after rendering

I'm developing a template system for webpages. A template consists of the following properties.

  • A name (part of the "template" class)
  • Sections (linked to the template class)
  • Fields (linked to a section)

It's pretty basic and it works when I got the template all setup in the database itself. Now I want to create a template in my CMS application. To accomplish this I have rendered a pretty basic formtype form which has the name property of the template.

After the user has entered a name for the template, the user should be able to create sections and fields on the fly(directly from the rendered page itself). To spare me some time I want to ask you if it's possible to attach the sections and fields to the formtype dynamically so Doctrine can pick it up and persist the objects automatically without too much trouble.

您正在寻找的可能是表单事件表单集合的组合

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM