[Form] Allow setting different options to repeating fields
This commit is contained in:
parent
18d3dfe0bf
commit
8819db3923
@ -27,8 +27,9 @@ class RepeatedType extends AbstractType
|
|||||||
$options['first_name'],
|
$options['first_name'],
|
||||||
$options['second_name'],
|
$options['second_name'],
|
||||||
)))
|
)))
|
||||||
->add($options['first_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'], $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)
|
public function getDefaultOptions(array $options)
|
||||||
{
|
{
|
||||||
return array(
|
return array(
|
||||||
'type' => 'text',
|
'type' => 'text',
|
||||||
'options' => array(),
|
'options' => array(),
|
||||||
'first_name' => 'first',
|
'first_options' => array(),
|
||||||
'second_name' => 'second',
|
'second_options' => array(),
|
||||||
'error_bubbling' => false,
|
'first_name' => 'first',
|
||||||
|
'second_name' => 'second',
|
||||||
|
'error_bubbling' => false,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user