make suggested changes for default value

This commit is contained in:
IamPersistent 2011-10-17 03:27:04 -07:00
parent c507b1db73
commit fbd2a0ed9a

View File

@ -25,8 +25,7 @@ class CollectionType extends AbstractType
public function buildForm(FormBuilder $builder, array $options)
{
if ($options['allow_add'] && $options['prototype']) {
$prototypeName = empty($options['prototype_name']) ? '$$name$$' : '$$' . $options['prototype_name'] . '$$';
$prototype = $builder->create($prototypeName, $options['type'], $options['options']);
$prototype = $builder->create('$$' . $options['prototype_name'] . '$$', $options['type'], $options['options']);
$builder->setAttribute('prototype', $prototype->getForm());
}