[英]The service “form.type.users” has a dependency on a non-existent service “security.context”
[英]The service “twig” has a dependency on a non-existent service “security.context”
當我將項目從Symfony 2.6升級到Symfony 3.4時,升級時遇到了許多問題,因此必須更新許多依賴項。 但是我面臨的一個問題是:
服務“ twig”依賴於不存在的服務“ security.context”
我讀到security.context
在2.6中已棄用,它分為TokenStorage
和AuthorizationChecker
。
我需要做些什么,請幫我解決問題?
在您的登錄控制器中移動
$this->container->get('security.context')->isGranted('IS_AUTHENTICATED_FULLY');
至
$this->container->get('security.authorization_checker')->isGranted('IS_AUTHENTICATED_FULLY'))
還可以考慮為您的服務使用自動裝配https://symfony.com/doc/current/service_container/autowiring.html 。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.