yet another web developer blog about technical issues i run into. mostly code snippets and stuff.

Wednesday, March 19, 2014

Custom page & controller in Sonata Admin Bundle

I was stuck for a while trying to figure out how to get my own page into the admin backend of the Sonata Admin Bundle. Specifically, I wanted to have a link in the top menu bar to a page that is created by a controller of mine.

Let's assume that our bundle is the AcmeDemoBundle, residing in the src/Acme/DemoBundle/ folder, which is where most of the following files are in as well.

The first step was to extend the standard_layout.html.twig from the SonataAdminBundle by creating a file here: Resources/views/standard_layout.html.twig