简体   繁体   中英

Symfony - extension able to load the configuration

I am trying to install FOSUserBundle based on a documentation.

I have created fos_user.yaml file in conifig/packages path with:

fos_user:
db_driver: orm
firewall_name: main
user_class: bundles\App\Base\Entity\User
from_email:
    address: "my@mail.com"
    sender_name: "Name Surname"
framework:
    translator: ~

But it keeps throwing error:

There is no extension able to load the configuration for "from_email" (in /
.. var/www/html/config/packages/fos_user.yaml). Looked for namespace "from_ema
,, il", found "framework", "sensio_framework_extra", "doctrine_cache", "doctri
,, ne", "doctrine_migrations", "maker", "security", "swiftmailer", "stof_doctr
,, ine_extensions", "doctrine_fixtures", "twig", "twig_extra", "fos_user"

I tried of making from_email.yaml but it won't work.

The configuration that you provided in your fos_user.yaml file isn't well indented.

If you don't indent the values under the fos_user key, Symfony will try to find a configuration file for each of them.

You should write instead:

fos_user:
    db_driver: orm
    firewall_name: main
    user_class: bundles\App\Base\Entity\User
    from_email:
        address: "my@mail.com"
        sender_name: "Name Surname"

For more details, you can see the full bundle configuration here

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