public function breadcrumbAction(Request $request, $title = '') {
        if (!$this->getDispatcher()->hasListeners(ThemeEvents::THEME_BREADCRUMB)) {
            return new Response();
        }

        $active = $this->getDispatcher()->dispatch(ThemeEvents::THEME_BREADCRUMB, new SidebarMenuEvent($request))->getActive();
        /** @var $active MenuItemInterface */
        $list = [];
        if($active) {
            $list[] = $active;
            while(null !== ($item = $active->getActiveChild())) {
                $list[] = $item;
                $active = $item;
            }
        }

        return $this->render('AvanzuAdminThemeBundle:Breadcrumb:breadcrumb.html.twig', [
                'active' => $list,
                'title' => $title,
            ]);
    }
public function breadcrumbAction(Request $request, $title = '') {
        if (!$this->getDispatcher()->hasListeners(ThemeEvents::THEME_BREADCRUMB)) {
            return new Response();
        }

        $active = $this->getDispatcher()->dispatch(ThemeEvents::THEME_BREADCRUMB, new SidebarMenuEvent($request))->getActive();
        /** @var $active MenuItemInterface */
        $list = [];
        if($active) {
            $list[] = $active;
            while(null !== ($item = $active->getActiveChild())) {
                $list[] = $item;
                $active = $item;
            }
        }

        return $this->render('AvanzuAdminThemeBundle:Breadcrumb:breadcrumb.html.twig', [
                'active' => $list,
                'title' => $title,
            ]);
    }
public function breadcrumbAction ( Request $ request , $ title = '' ) { if ( ! $ this -> getDispatcher ( ) -> hasListeners ( ThemeEvents :: THEME_BREADCRUMB ) ) { return new Response ( ) ; } $ active = $ this -> getDispatcher ( ) -> dispatch ( ThemeEvents :: THEME_BREADCRUMB , new SidebarMenuEvent ( $ request ) ) -> getActive ( ) ; /** @var $active MenuItemInterface */ $ list = [ ] ; if ( $ active ) { $ list [ ] = $ active ; while ( null !== ( $ item = $ active -> getActiveChild ( ) ) ) { $ list [ ] = $ item ; $ active = $ item ; } } return $ this -> render ( 'AvanzuAdminThemeBundle:Breadcrumb:breadcrumb.html.twig' , [ 'active' => $ list , 'title' => $ title , ] ) ; }
Controller Reference action to be called inside the layout.

Triggers the {@link ThemeEvents::THEME_BREADCRUMB} to receive the currently active menu chain.

If there are no listeners attached for this event, the return value is an empty response.

@param Request $request
@param string  $title

@return Response
Controller Reference action to be called inside the layout .