控制器"JMSTranslationBundleControllerTranslateController"具有必需的构造函数参数,并且容器中不存在



I 将 Symfony 从 3.3 升级到 4.1 ,JMS\TranslationBundle 停止工作。

错误是

Controller "JMSTranslationBundleControllerTranslateController" has required constructor arguments and does not exist in the container. Did you forget to define such a service?

我尝试导入

进口: - { resource: '@JMSTranslationBundle/Resources/config/services.xml' }

无需更改

我有同样的问题。我在这里写了评论:

构造函数参数,并且不存在于容器中

这对我来说是:

添加到服务.yaml:

JMSTranslationBundleControllerTranslateController:
public: true
arguments:
$configFactory: '@jms_translation.config_factory'
$loader: '@jms_translation.loader_manager'

JMSTranslationBundleControllerApiController:
public: true
arguments:
$configFactory: '@jms_translation.config_factory'
$updater: '@jms_translation.updater'

并评论或删除以下内容:

#imports:
#- { resource: '@JMSTranslationBundle/Resources/config/services.xml' }

最新更新