Matt
Matt

Reputation: 127

Sonata admin - 2 admins in one

Is it possible to display the form of an admin in/next to the form of another admin?

$formMapper
            ->add('color', null, array('label' => 'label.color'))
            ->add('coverButtons', 'sonata_type_collection', array(), array(
                'edit' => 'inline',
                'inline' => 'table',
            ));

Right now, it's displaying a button which opens a pop-up with the other admin form but I would like to display the other admin form on the same page. Are there any configrations that might do this?

Upvotes: 2

Views: 557

Answers (1)

chalasr
chalasr

Reputation: 13167

You are looking for sonata_type_admin, example :

$formMapper->add('coverButtons', 'sonata_type_admin', array(), array(
    'edit'       => 'inline',
    'inline'     => 'table',
    'admin_code' => 'sonata.admin.your_admin_service_name',
));

This will embed the form of the admin_code inside your parent form.

See the form field chapter of SonataAdmin documentation

Upvotes: 1

Related Questions