src/Kunstmaan/MenuBundle/Controller/MenuItemAdminListController.php
public function indexAction(Request $request, $menuid)
    {
        $menuRepo = $this->getDoctrine()->getManager()->getRepository(
            $this->container->getParameter('kunstmaan_menu.entity.menu.class')
        );

        /** @var BaseMenu $menu */
        $menu = $menuRepo->find($menuid);
        if ($menu->getLocale() != $request->getLocale()) {
            /** @var BaseMenu $translatedMenu */
            $translatedMenu = $menuRepo->findOneBy(['locale' => $request->getLocale(), 'name' => $menu->getName()]);
            $menuid = $translatedMenu->getId();
        }

        $configurator = $this->getAdminListConfigurator($request, $menuid);
        $itemRoute = function (EntityInterface $item) use ($menuid) {
            return array(
                'path' => 'kunstmaanmenubundle_admin_menuitem_move_up',
                'params' => array(
                    'menuid' => $menuid,
                    'item' => $item->getId(),
                ),
            );
        };
        $configurator->addItemAction(new SimpleItemAction($itemRoute, 'arrow-up', 'kuma_admin_list.action.move_up'));

        $itemRoute = function (EntityInterface $item) use ($menuid) {
            return array(
                'path' => 'kunstmaanmenubundle_admin_menuitem_move_down',
                'params' => array(
                    'menuid' => $menuid,
                    'item' => $item->getId(),
                ),
            );
        };
        $configurator->addItemAction(new SimpleItemAction($itemRoute, 'arrow-down', 'kuma_admin_list.action.move_down'));

        return parent::doIndexAction($configurator, $request);
    }
public function indexAction(Request $request, $menuid)
    {
        $menuRepo = $this->getDoctrine()->getManager()->getRepository(
            $this->container->getParameter('kunstmaan_menu.entity.menu.class')
        );

        /** @var BaseMenu $menu */
        $menu = $menuRepo->find($menuid);
        if ($menu->getLocale() != $request->getLocale()) {
            /** @var BaseMenu $translatedMenu */
            $translatedMenu = $menuRepo->findOneBy(['locale' => $request->getLocale(), 'name' => $menu->getName()]);
            $menuid = $translatedMenu->getId();
        }

        $configurator = $this->getAdminListConfigurator($request, $menuid);
        $itemRoute = function (EntityInterface $item) use ($menuid) {
            return array(
                'path' => 'kunstmaanmenubundle_admin_menuitem_move_up',
                'params' => array(
                    'menuid' => $menuid,
                    'item' => $item->getId(),
                ),
            );
        };
        $configurator->addItemAction(new SimpleItemAction($itemRoute, 'arrow-up', 'kuma_admin_list.action.move_up'));

        $itemRoute = function (EntityInterface $item) use ($menuid) {
            return array(
                'path' => 'kunstmaanmenubundle_admin_menuitem_move_down',
                'params' => array(
                    'menuid' => $menuid,
                    'item' => $item->getId(),
                ),
            );
        };
        $configurator->addItemAction(new SimpleItemAction($itemRoute, 'arrow-down', 'kuma_admin_list.action.move_down'));

        return parent::doIndexAction($configurator, $request);
    }
public function indexAction ( Request $ request , $ menuid ) { $ menuRepo = $ this -> getDoctrine ( ) -> getManager ( ) -> getRepository ( $ this -> container -> getParameter ( 'kunstmaan_menu.entity.menu.class' ) ) ; /** @var BaseMenu $menu */ $ menu = $ menuRepo -> find ( $ menuid ) ; if ( $ menu -> getLocale ( ) != $ request -> getLocale ( ) ) { /** @var BaseMenu $translatedMenu */ $ translatedMenu = $ menuRepo -> findOneBy ( [ 'locale' => $ request -> getLocale ( ) , 'name' => $ menu -> getName ( ) ] ) ; $ menuid = $ translatedMenu -> getId ( ) ; } $ configurator = $ this -> getAdminListConfigurator ( $ request , $ menuid ) ; $ itemRoute = function ( EntityInterface $ item ) use ( $ menuid ) { return array ( 'path' => 'kunstmaanmenubundle_admin_menuitem_move_up' , 'params' => array ( 'menuid' => $ menuid , 'item' => $ item -> getId ( ) , ) , ) ; } ; $ configurator -> addItemAction ( new SimpleItemAction ( $ itemRoute , 'arrow-up' , 'kuma_admin_list.action.move_up' ) ) ; $ itemRoute = function ( EntityInterface $ item ) use ( $ menuid ) { return array ( 'path' => 'kunstmaanmenubundle_admin_menuitem_move_down' , 'params' => array ( 'menuid' => $ menuid , 'item' => $ item -> getId ( ) , ) , ) ; } ; $ configurator -> addItemAction ( new SimpleItemAction ( $ itemRoute , 'arrow-down' , 'kuma_admin_list.action.move_down' ) ) ; return parent :: doIndexAction ( $ configurator , $ request ) ; }
The index action

@param Request $request
@param int     $menuid

@return Response

@Route("/{menuid}/items", name="kunstmaanmenubundle_admin_menuitem")
The index action