我有一个基于symfony3的应用程序。我确实从文档注册并登录了。这是我在security.yml中的代码
security:
encoders:
AppBundle\Entity\User: bcrypt
providers:
our_db_provider:
entity:
class: AppBundle:User
property: username
firewalls:
# disables authentication for assets and the profiler, adapt it according to your needs
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
pattern: ^/
http_basic: ~
provider: our_db_provider
form_login:
login_path: login
check_path: login
在本地主机上是-FileLoader.php第118行中的FileLoaderLoadException:文件“ C:\ xampp \ htdocs \ game \ app / config / security.yml”在C:\ xampp \ htdocs \ game \ app /中不包含有效的YAML config \ security.yml(从“ C:\ xampp \ htdocs \ game \ app / config \ config.yml”导入)。
你能告诉我我在做什么错吗?来自我的应用程序的另一个代码在这里-https://github.com/xrbartek/mirko
对于缩进将如何更改配置结构,YAML非常特别。您必须在整个文件中保持一致的空格数。
我看过您的配置,可以看到通过在YAML解析器中运行它而出现了一些问题。
我已将其更正为以下有效的YAML:
# To get started with security, check out the documentation:
# http://symfony.com/doc/current/book/security.html
security:
encoders:
AppBundle\Entity\User: bcrypt
# http://symfony.com/doc/current/book/security.html#where-do-users-come-from-user-providers
providers:
our_db_provider:
entity:
class: AppBundle:User
property: username
firewalls:
# disables authentication for assets and the profiler, adapt it according to your needs
dev:
pattern: ^/(_(profiler|wdt)|css|images|js)/
security: false
main:
pattern: ^/
http_basic: ~
provider: our_db_provider
form_login:
login_path: login
check_path: login
# activate different ways to authenticate
# http_basic: ~
# http://symfony.com/doc/current/book/security.html#a-configuring-how-your-users-will-authenticate
# form_login: ~
# http://symfony.com/doc/current/cookbook/security/form_login_setup.html
# app/config/security.yml
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句