|
@@ -229,3 +229,35 @@ You will just need to change the way forms are configured in order to take into
|
|
|
$form->add('year', 'integer');
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+Dropdowns in Tab Menu
|
|
|
+---------------------
|
|
|
+
|
|
|
+You can use dropdowns inside the Tab Menu by default. This can be achieved by using
|
|
|
+the `"dropdown" => true` attribute:
|
|
|
+
|
|
|
+.. code-block:: php
|
|
|
+
|
|
|
+ <?php
|
|
|
+ // YourNS\AdminBundle\Admin\PersonAdmin.php
|
|
|
+
|
|
|
+ protected function configureTabMenu(MenuItemInterface $menu, $action, AdminInterface $childAdmin = null)
|
|
|
+ {
|
|
|
+ // ...other tab menu stuff
|
|
|
+
|
|
|
+ $menu->addChild('comments', array('attributes' => array('dropdown' => true)));
|
|
|
+ $menu['comments']->addChild('list', array('uri' => $admin->generateUrl('listComment', array('id' => $id))));
|
|
|
+ $menu['comments']->addChild('create', array('uri' => $admin->generateUrl('addComment', array('id' => $id))));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+If you want to use the Tab Menu in a different way, you can replace the Menu Template:
|
|
|
+
|
|
|
+.. configuration-block::
|
|
|
+
|
|
|
+ .. code-block:: yaml
|
|
|
+
|
|
|
+ sonata_admin:
|
|
|
+ templates:
|
|
|
+ tab_menu_template: YourNSAdminBundle:Admin:own_tab_menu_template.html.twig
|