sonata-project / SonataAdminBundle

The missing Symfony Admin Generator
https://docs.sonata-project.org/projects/SonataAdminBundle
MIT License
2.11k stars 1.26k forks source link

side menu option #490

Closed Sgnx closed 8 years ago

Sgnx commented 12 years ago

hi,

documentation says that there is a side menu option ? Do i have to configure it in config.yml ?

If anyone have a simple example it will work for me.

rande commented 11 years ago

There is no official documentation, however you can review the Sonata's Bundles for example

pmartelletti commented 11 years ago

Suppose I have an 'orders' admin class, tagged as sonata.admin.orders.

Then, how sould I add a side menu to show the orders of a user (knowing that the user has a $orders ArrayCollection).

I've tried this:

$menu->addChild(
        $this->trans('sidemenu.link_view_comments'),
        array('uri' => $admin->generateUrl('sonata.admin.orders', array('id' => $id)))
    );

But this does not seem to work. I'm getting a bad route error. Is there any extra config that should be done?

webdevilopers commented 9 years ago

Your code looks fine @pmartelletti . Have you configured your $user as parent and added $orders as child in your service classes?

Explained here: http://sonata-project.org/bundles/admin/master/doc/reference/architecture.html#create-child-admins

webdevilopers commented 9 years ago

@Sgnx @pmartelletti Can we close this issue?

pmartelletti commented 9 years ago

@webdevilopers feel free to do so. :smile:

webdevilopers commented 9 years ago

I can't, but @rande can! ;)

webdevilopers commented 9 years ago

Please close @Sgnx, @rande .