php – 您已请求合成服务(“请求”). DIC不知道如何构建此服务

发布时间:2022-04-30 发布网站:脚本宝典
脚本宝典收集整理的这篇文章主要介绍了php – 您已请求合成服务(“请求”). DIC不知道如何构建此服务脚本宝典觉得挺不错的,现在分享给大家,也给大家做个参考。

在composer.json中添加“knplabs / knp-paginator-bundle”:“~2.5.3”后收到错误并运行更新.

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);
    }

转储是好的,当我删除错误happing?

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

解决方法

查看 https://github.com/symfony/symfony/issues/19840,它与您的代码无关,但它是2.7.17和2.8.10版本附带的Symfony错误.我认为应该发布新标签,因为它将很快修复此错误,因为它将使用RequestStack服务打破大多数项目.

编辑:该问题已在2.8.112.7.18版本中修复.

脚本宝典总结

以上是脚本宝典为你收集整理的php – 您已请求合成服务(“请求”). DIC不知道如何构建此服务全部内容,希望文章能够帮你解决php – 您已请求合成服务(“请求”). DIC不知道如何构建此服务所遇到的问题。

如果觉得脚本宝典网站内容还不错,欢迎将脚本宝典推荐好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。