Symfony2 - ajax的容器问题

时间:2014-12-08 15:06:32

标签: ajax symfony controller containers

我遇到了一个我无法找到解决方案的特殊问题。

在通常的流程中,我的 WelcomeController / listAction 从容器调用两个服务,方法是$ this-> container-> get(" the_service")。找到并正确使用 Service1 Service2

我需要对控制器 WelcomeController / changeListAction 进行ajax调用,然后转发给我的WelcomeController。在这种情况下,找到服务 Service1 但是当调用 Service2 时,我收到了错误500.

我试图以这种方式检索参数($ this-> container-> getParameter(" my_param")),虽然它在没有ajax的情况下工作,但它也是失败了。 容器似乎是个问题,但无论如何都会找到 Service1

你有什么想法吗?

谢谢!

services.yml中的服务定义:

google_user_helper:
    class: Company\MainBundle\Helpers\GoogleUserHelper
    arguments: [@doctrine.orm.entity_manager, @bit_google.api, @session, %demo_length%]        

utils:        
    class: Company\MainBundle\Helpers\Utils    
    arguments: [@doctrine.orm.entity_manager,%indemnities%,@google_user_helper] 

始终有效的 Service1 是google_user_helper。

0 个答案:

没有答案