Controller/OrderController.php
public function tableAction($page, Request $request)
    {
        $or = $this->getDoctrine()->getManager()->getRepository('DyweeOrderBundle:BaseOrder');


        /*$form = $this->get('form.factory')->create(OrderFilterType::class)
            ->add('chercher', SubmitType::class)
        ;

        $filterActive = false;

        if($form->handleRequest($request)->isValid())
        {
            $query = $or->findAllForPagination($state);
            // build the query from the given form object
            $this->get('lexik_form_filter.query_builder_updater')->addFilterConditions($form, $query);

            $filterActive = true;
        }
        else */

        $paginator  = $this->get('knp_paginator');
        $pagination = $paginator->paginate(
            $or->findAllForPagination($request->query->get('state')),
            $request->query->get('page', $page), //page number
            40 // limit per page
        );



        $data = array(
            'pagination' => $pagination,
            //'searchForm' => $form->createView(),
            //'filterActive' => $filterActive,
            'activeState' => $request->query->get('state'),
            'states' => array(BaseOrderInterface::STATE_IN_SESSION, BaseOrderInterface::STATE_WAITING, BaseOrderInterface::STATE_IN_PROGRESS, BaseOrderInterface::STATE_FINALIZED),
        );

        return $this->render('DyweeOrderBundle:Order:table.html.twig', $data);
    }
public function tableAction($page, Request $request)
    {
        $or = $this->getDoctrine()->getManager()->getRepository('DyweeOrderBundle:BaseOrder');


        /*$form = $this->get('form.factory')->create(OrderFilterType::class)
            ->add('chercher', SubmitType::class)
        ;

        $filterActive = false;

        if($form->handleRequest($request)->isValid())
        {
            $query = $or->findAllForPagination($state);
            // build the query from the given form object
            $this->get('lexik_form_filter.query_builder_updater')->addFilterConditions($form, $query);

            $filterActive = true;
        }
        else */

        $paginator  = $this->get('knp_paginator');
        $pagination = $paginator->paginate(
            $or->findAllForPagination($request->query->get('state')),
            $request->query->get('page', $page), //page number
            40 // limit per page
        );



        $data = array(
            'pagination' => $pagination,
            //'searchForm' => $form->createView(),
            //'filterActive' => $filterActive,
            'activeState' => $request->query->get('state'),
            'states' => array(BaseOrderInterface::STATE_IN_SESSION, BaseOrderInterface::STATE_WAITING, BaseOrderInterface::STATE_IN_PROGRESS, BaseOrderInterface::STATE_FINALIZED),
        );

        return $this->render('DyweeOrderBundle:Order:table.html.twig', $data);
    }
@Route(path="admin/orders", name="order_adminList", defaults={"page": 1})
@param Request $request

@return Response