Symfony2错误Security.yml

时间:2015-04-24 14:45:38

标签: php symfony doctrine-orm

我正在学习Symfony2'我跟着这个:

http://symfony.com/doc/current/cookbook/security/entity_provider.html#configure-security-to-load-from-your-entity

但是,当我在文档中提到的security.yml中进行更改时,我收到以下错误:

[Symfony\Component\Debug\Exception\ContextErrorException]
Notice: Undefined index: algorithm

这是给我错误的代码:

# app/config/security.yml
security:
    encoders:
        AppBundle\Entity\User:
            algorithm: bcrypt

请帮我解决这个问题。它不应该像Symfony2 Docs中那样显示错误。

1 个答案:

答案 0 :(得分:1)

替换你的config.yml

为:

security:
    encoders:
        AppBundle\Entity\User: bcrypt