0
votes

to-many relations between 2 class , invitation and invitees , i m using sonata_type_collection , but the add button to add invitee not

$formMapper
        ->add('invitees' , 'sonata_type_collection',
            array(
                'required' => true,
                'by_reference' => false,
                'btn_add'=>true,

            ),array(
                'edit' => 'inline',
                'allow_delete' => true,
                'allow_add'=>true,
                'admin_code'      => 'sonata.admin.invitees'
            )
        )
       ;

this my formbuilder in my invitationAction, if i add a invitee manual i can see thats the form is working my problem is only with btn_add is not showing . any help ?

1

1 Answers

0
votes

The 'btn_add' option is only for a custom label as far as I know. If you remove the complete line, Sonata will give you a default button value of 'Add new'.

Otherwise for example btn_add => 'Whatever' will give a button that looks something like this; Whatever instead of the default Add new.