src/Compo/Sonata/SeoBundle/Block/Breadcrumb/BaseBreadcrumbMenuBlockService.php
protected function getRootMenu(BlockContextInterface $blockContext)
    {
        $settings = $blockContext->getSettings();

        $menu = $this->getFactory()->createItem('breadcrumb');

        $menu->setChildrenAttribute('class', 'breadcrumb');

        if (!$settings['current_uri']) {
            $settings['current_uri'] = $this->getRequest()->getRequestUri();
        }

        if (method_exists($menu, 'setCurrentUri')) {
            $menu->setCurrentUri($settings['current_uri']);
        }

        if (method_exists($menu, 'setCurrent')) {
            $menu->setCurrent($settings['current_uri']);
        }

        $uri = $this->getContainer()->get('router')->generate(
            'page_slug',
            ['path' => '/']
        );

        if ($settings['include_homepage_link']) {
            $menu->addChild('sonata_seo_homepage_breadcrumb', ['uri' => $uri]);
        }

        return $menu;
    }
protected function getRootMenu(BlockContextInterface $blockContext)
    {
        $settings = $blockContext->getSettings();

        $menu = $this->getFactory()->createItem('breadcrumb');

        $menu->setChildrenAttribute('class', 'breadcrumb');

        if (!$settings['current_uri']) {
            $settings['current_uri'] = $this->getRequest()->getRequestUri();
        }

        if (method_exists($menu, 'setCurrentUri')) {
            $menu->setCurrentUri($settings['current_uri']);
        }

        if (method_exists($menu, 'setCurrent')) {
            $menu->setCurrent($settings['current_uri']);
        }

        $uri = $this->getContainer()->get('router')->generate(
            'page_slug',
            ['path' => '/']
        );

        if ($settings['include_homepage_link']) {
            $menu->addChild('sonata_seo_homepage_breadcrumb', ['uri' => $uri]);
        }

        return $menu;
    }
protected function getRootMenu ( BlockContextInterface $ blockContext ) { $ settings = $ blockContext -> getSettings ( ) ; $ menu = $ this -> getFactory ( ) -> createItem ( 'breadcrumb' ) ; $ menu -> setChildrenAttribute ( 'class' , 'breadcrumb' ) ; if ( ! $ settings [ 'current_uri' ] ) { $ settings [ 'current_uri' ] = $ this -> getRequest ( ) -> getRequestUri ( ) ; } if ( method_exists ( $ menu , 'setCurrentUri' ) ) { $ menu -> setCurrentUri ( $ settings [ 'current_uri' ] ) ; } if ( method_exists ( $ menu , 'setCurrent' ) ) { $ menu -> setCurrent ( $ settings [ 'current_uri' ] ) ; } $ uri = $ this -> getContainer ( ) -> get ( 'router' ) -> generate ( 'page_slug' , [ 'path' => '/' ] ) ; if ( $ settings [ 'include_homepage_link' ] ) { $ menu -> addChild ( 'sonata_seo_homepage_breadcrumb' , [ 'uri' => $ uri ] ) ; } return $ menu ; }
Initialize breadcrumb menu.

@param BlockContextInterface $blockContext

@return \Knp\Menu\ItemInterface
Initialize breadcrumb menu .