简体   繁体   中英

InvalidConfigurationException while creating a bundle in symfony by console

I want to generate a bundle in symfony2 with the following command:

php app/console generate:bundle --namespace=MyApp/SecurityBundle --format=yml

but when running this command I get the following error:

[Symfony\Component\Config\Definition\Exception\InvalidConfigurationException]
The child node "providers" at path "security" must be configured.

I just started learning symfony. I can not figure out why I get this? is SecurityBundle is a reserved name? I read in symfony tutorial where there was a bundle named AcmeSecurityBundle , If it is a reserved name and I can not use it how the AcmeSecurityBundle is created? I don't have any problem in creating a bundle in other names.

Here's my app/config/security.yml content:

security:
    firewalls:
        secured_area:
            pattern:    ^/
            anonymous:  ~
            form_login:
                login_path:     login
                check_path:     login_check

You need provider in security.yml like:

providers:
    in_memory:
        memory:
            users:
                user: { password: userpass, roles: [ 'ROLE_USER' ] }
                admin: { password: adminpass, roles: [ 'ROLE_ADMIN' ] }

Check out default security.yml.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM