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), 3);
$pagination->setUsedRoute(\Avtostil\SharedBundle\Entity\Page::GALLERY_LISTING);
$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
source
share