Symfony2“security.firewalls.main”下无法识别的选项“simple_form”

时间:2014-01-25 12:45:52

标签: php symfony

我正在关注本教程Custom Password Authenticator,并在尝试实现简单表单时出现以下错误:

InvalidConfigurationException: Unrecognized options "simple_form" under "security.firewalls.main"

这是我的security.yml

security:
    encoders:
        GigCapitol/MasterBundle/Entity/User: plaintext

    role_hierarchy:
        ROLE_USER:        ROLE_USER
        ROLE_ADMIN:       ROLE_ADMIN
        ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]

    providers:
            users:
                entity: { class: GigCapitolMasterBundle:User, property: username }

    firewalls:
        dev:
            pattern:  ^/(_(profiler|wdt)|css|images|js)/
            security: false

        main:
            pattern:    ^/
            anonymous:  ~
            provider: users
            simple-form:
                authenticator: MasterAuthenticator
                login_path: master_index
                check_path: master_login_check


    access_control:
        - { path: /, roles: IS_AUTHENTICATED_ANONYMOUSLY }
        - { path: ^/, roles: IS_AUTHENTICATED_FULLY }
        #- { path: ^/login, roles: IS_AUTHENTICATED_ANONYMOUSLY, requires_channel: https }

这里似乎有什么问题?

2 个答案:

答案 0 :(得分:0)

似乎正确的键是“simple_form”,你有“简单形式”。

答案 1 :(得分:0)

似乎我的版本是2.0左右,simple_form是在2.2

中实现的