示例#1
0
 /**
  * Add a group of fields to the form.
  *
  * @param Group $group
  */
 protected function _addGroup(Group $group)
 {
     $values = array();
     foreach ($group->getFields() as $name => $field) {
         $values[$name] = $field->getValue();
     }
     $builder = $this->_factory->createNamedBuilder($group->getName(), 'form', $values);
     foreach ($group->getFields() as $field) {
         $field->getFormField($builder);
     }
     $this->_builder->add($builder, 'form', ['label' => $group->getLabel()]);
 }
 protected function _appendGroup(Field\Group $group, $sequence = null)
 {
     foreach ($group->getFields() as $field) {
         $this->_appendField($field, $group->getName(), $sequence);
     }
 }