简体   繁体   中英

Symfony FOS user bundle initiation

I have a problem with installing FOS user bundle. I tried to search it everywhere, but probably I'm too dumb and can't find it.

I've created an entity called Admin and tried to run doctrine:schema:update --force I've got an error: The child node "from_email" at path "fos_user" must be configured.

Here is my config.yml fos part.

fos_user:
    db_driver: orm # other valid values are 'mongodb' and 'couchdb'
    firewall_name: main
    user_class: AppBundle\Entity\Admin

any suggestions?

in your config.yml add from_email at path "fos_user":

# ...
fos_user:
    db_driver: orm # other valid values are 'mongodb' and 'couchdb'
    firewall_name: main
    user_class: AppBundle\Entity\Admin
    # ...
    from_email:
        address: you@example.com
        sender_name: You
# ...

More info : Step 5: Configure the FOSUserBundle

In your config.yml add from_email at path "fos_user":

fos_user:
  db_driver:      orm # can be orm or odm
  firewall_name:  main
  user_class:     Sonata\UserBundle\Entity\BaseUser
  from_email:
    address: "%mailer_host%"
    sender_name: "%mailer_user%"

and you get those values from parameters.yml file

# This file is auto-generated during the composer install
parameters:

    mailer_host: 127.0.0.1
    mailer_user: "mailer_user"

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