使用模板时循环security.context。 Symfony2的

时间:2015-04-06 17:02:56

标签: symfony

我有一个问题,我无法找到解决方案。我编写了自己的安全提供程序,授权用户不将其保存在任何odb或orm中。我在会话中绑定了经过身份验证的用户,如果用户没有会话,我认为他没有登录。所以,当我尝试进行身份验证时,我有例外:

Circular reference detected for service "security.context", path: "security.firewall.map.context.main -> security.context -> security.authentication.manager -security.authentication.provider.wsse.main   -> wsse_provider ->  privatmarket.businessbundle.businessauth.model -business_account.service -> company_info.service -> templating -> debug.templating.engine.twig -> twig".

此代码中出现错误:

    $body = $this->container->get('templating')->renderResponse('::XML-templates/company_info.xml.twig', array(
        'session' => $session,
        'ekb_id' => $ekbId
    ))->getContent();

当我第二次验证时 - 一切正常。

如果我将body写为xml字符串 - 所有工作都可以从第一个auth开始。我真的不明白该怎么做。

P.S。我读过,这个问题在Symfony 2.6的版本中解决了。我用2.3

0 个答案:

没有答案