src/Controller/FrontendPageController.php
public function adminNavbarAction(Request $request, $page_id = null)
    {
        if ($page_id) {

            /** @var \Networking\InitCmsBundle\Entity\PageManager $pageManager */
            $pageManager = $this->container->get('networking_init_cms.page_manager');
            $page = $pageManager->find($page_id);
            $request->attributes->set('_content', $page);
        }
        $response = $this->render(
            '@NetworkingInitCms/Admin/esi_admin_navbar.html.twig',
            ['admin_pool' => $this->getAdminPool()]
        );

        // set the shared max age - which also marks the response as public
        $response->setSharedMaxAge(10);

        return $response;
    }
public function adminNavbarAction(Request $request, $page_id = null)
    {
        if ($page_id) {

            /** @var \Networking\InitCmsBundle\Entity\PageManager $pageManager */
            $pageManager = $this->container->get('networking_init_cms.page_manager');
            $page = $pageManager->find($page_id);
            $request->attributes->set('_content', $page);
        }
        $response = $this->render(
            '@NetworkingInitCms/Admin/esi_admin_navbar.html.twig',
            ['admin_pool' => $this->getAdminPool()]
        );

        // set the shared max age - which also marks the response as public
        $response->setSharedMaxAge(10);

        return $response;
    }
public function adminNavbarAction ( Request $ request , $ page_id = null ) { if ( $ page_id ) { /** @var \Networking\InitCmsBundle\Entity\PageManager $pageManager */ $ pageManager = $ this -> container -> get ( 'networking_init_cms.page_manager' ) ; $ page = $ pageManager -> find ( $ page_id ) ; $ request -> attributes -> set ( '_content' , $ page ) ; } $ response = $ this -> render ( '@NetworkingInitCms/Admin/esi_admin_navbar.html.twig' , [ 'admin_pool' => $ this -> getAdminPool ( ) ] ) ; // set the shared max age - which also marks the response as public $ response -> setSharedMaxAge ( 10 ) ; return $ response ; }
Deliver the admin navigation bar via ajax.

@param null $page_id

@return Response
Deliver the admin navigation bar via ajax .