You requested a synthetic service ("request"). DIC does not know how to build this service

You requested a synthetic service ("request"). DIC does not know how to build this service.

The error received after adding "knplabs / knp-paginator-bundle": "~ 2.5.3" to composer.json and starting the update.

 public function listingAction(Request $request)
    {
        $em = $this->getDoctrine()->getManager();

        $list = $em->getRepository('Avtostil\SharedBundle\Entity\Gallery')->findAll();

        $paginator = $this->get('knp_paginator');
        $pagination = $paginator->paginate($list, $request->query->getInt('page', 1)/* page number */, 3/* limit per page */);
        $pagination->setUsedRoute(\Avtostil\SharedBundle\Entity\Page::GALLERY_LISTING); /* QUICK AND DIRTY */

        $data = [];
        $data['galleries'] = $pagination;
        echo "<pre>";
        \Doctrine\Common\Util\Debug::dump('here');
        die();
        return $this->render('AvtostilOpenBundle:Gallery:listing.html.twig', $data);
    }

Is the dump ok when I delete the error?

in appDevDebugProjectContainer.php line 4094
at appDevDebugProjectContainer->getRequestService() in bootstrap.php.cache line 2189
at Container->get('request', '2') in appDevDebugProjectContainer.php line 7503
at appDevDebugProjectContainer->synchronizeRequestService() in bootstrap.php.cache line 2125
at Container->set('request', null, 'request') in bootstrap.php.cache line 3278
at ContainerAwareHttpKernel->handle(object(Request), '1', true) in bootstrap.php.cache line 2479
at Kernel->handle(object(Request)) in app_dev.php line 29
+4
source share
1 answer

https://github.com/symfony/symfony/issues/19840, , Symfony, 2.7.17 2.8.10 . , , , , RequestStack.

: ​​ 2.8.11 2.7. 18.

+3

Source: https://habr.com/ru/post/1653620/


All Articles