Kdyby / FormsReplicator

Other
30 stars 57 forks source link

Problematic styling of groups (default form renderer) #30

Open kahi opened 10 years ago

kahi commented 10 years ago

Since I cannot use addGroup() inside addDynamic(), I'm having trouble styling these "groups" of elements – or at least separate them from each other.

What are the options/best practices to this currently? Thank you.

fprochazka commented 10 years ago

Hi, I always render and style replicated inputs manually. I just write the template that foreaches the inputs.

jspetrak commented 7 years ago

@fprochazka Is there any example how to manually template just part of the form? I have form class that has a configured renderer and it just does not create any HTML surrounding a single addDynamic() container. Render the complete form manually would be the last resort solution.

Or is there any chance to extend the form renderrer to style dynamic containers?

I have also tried to use Container#setCurrentGroup but does not have any effect. $this->addDynamic('legs', function (Container $container) { $cg = new ControlGroup(); $cg->setOption('container', 'section class=oneLeg'); $container->setCurrentGroup($cg); $container->addText('from', 'From'); $container->addText('to', 'To'); }, 1);