Contrary to added groups, merged groups operate on the same object as
the group they are merged into.
class Entity
{
public $longitude;
public $latitude;
}
$entity = new Entity();
$form = new Form('entity', $entity, $validator);
$locationGroup = new FieldGroup('location');
$locationGroup->add(new TextField('longitude'));
$locationGroup->add(new TextField('latitude'));
$form->merge($locationGroup);
public merge ( |
||
$group |