我刚刚将我的 Symfony 2.2.2 项目升级到 2.3。我也在使用 FOSUserBundle。此捆绑包在项目 2.2.2 中运行良好。但是当我升级时,路由 /user/register 不再起作用。整个页面是空白的。Route /login 工作正常,我可以登录到我的页面,但注册页面是空白的。我没有更改此捆绑包中的任何内容。
在 composer.json 我有:
"require": {
"php": ">=5.3.3",
"symfony/symfony": "2.3.*",
"doctrine/orm": ">=2.2.3,<2.4-dev",
"doctrine/doctrine-bundle": "1.2.*",
"twig/extensions": "1.0.*",
"symfony/assetic-bundle": "2.3.*",
"symfony/swiftmailer-bundle": "2.3.*",
"symfony/monolog-bundle": "2.3.*",
"sensio/distribution-bundle": "2.3.*",
"sensio/framework-extra-bundle": "2.3.*",
"sensio/generator-bundle": "2.3.*",
"incenteev/composer-parameter-handler": "~2.0",
"jms/security-extra-bundle": "1.4.*@dev",
"jms/di-extra-bundle": "1.3.*@dev",
"friendsofsymfony/user-bundle": "dev-master",
"gedmo/doctrine-extensions": "dev-master",
"stof/doctrine-extensions-bundle" : "dev-master",
"knplabs/knp-paginator-bundle": "dev-master",
"knplabs/knp-time-bundle": "dev-master",
"ornicar/gravatar-bundle" : "dev-master",
"ob/highcharts-bundle": "dev-master",
"whiteoctober/breadcrumbs-bundle": "dev-master"
},
我的 /app/config/routing.yml
#...
user:
resource: "@AcmeUserBundle/Resources/config/routing.yml"
prefix: /
fos_user_security:
resource: "@FOSUserBundle/Resources/config/routing/security.xml"
fos_user_profile:
resource: "@FOSUserBundle/Resources/config/routing/profile.xml"
prefix: /user/profile
fos_user_register:
resource: "@FOSUserBundle/Resources/config/routing/registration.xml"
prefix: /user/register
fos_user_resetting:
resource: "@FOSUserBundle/Resources/config/routing/resetting.xml"
prefix: /user/resetting
fos_user_change_password:
resource: "@FOSUserBundle/Resources/config/routing/change_password.xml"
prefix: /user
# Internal routing configuration to handle ESI
#_internal:
# resource: "@FrameworkBundle/Resources/config/routing/internal.xml"
# prefix: /_internal
和文件:/src/Acme/UserBundle/Resources/config/routing.yml
user_list:
pattern: /admin/user/list
defaults: { _controller: AcmeUserBundle:Default:list }
user_change_role:
pattern: /admin/user/change-role/{id}/{role}
defaults: { _controller: AcmeUserBundle:Default:role }
requirements:
id: \d+
有人知道问题的解决方案吗?