[Form] Allow setting different options to repeating fields

This commit is contained in:
helmer 2011-06-16 04:37:01 -07:00 committed by root
parent 18d3dfe0bf
commit 8819db3923

View File

@ -27,8 +27,9 @@ class RepeatedType extends AbstractType
$options['first_name'],
$options['second_name'],
)))
->add($options['first_name'], $options['type'], $options['options'])
->add($options['second_name'], $options['type'], $options['options'])
->add($options['first_name'], $options['type'], 0 < count($options['first_options']) ? $options['first_options'] : $options['options'])
->add($options['second_name'], $options['type'], 0 < count($options['second_options']) ? $options['second_options'] : $options['options'])
;
}
@ -38,11 +39,13 @@ class RepeatedType extends AbstractType
public function getDefaultOptions(array $options)
{
return array(
'type' => 'text',
'options' => array(),
'first_name' => 'first',
'second_name' => 'second',
'error_bubbling' => false,
'type' => 'text',
'options' => array(),
'first_options' => array(),
'second_options' => array(),
'first_name' => 'first',
'second_name' => 'second',
'error_bubbling' => false,
);
}