如何在symfony中将一些参数传递给fosuserbundle

时间:2015-08-08 07:11:12

标签: symfony fosuserbundle

我在我的网站上使用fosuserbundle进行用户管理。 它工作正常,但我需要在fos路由器中添加“lang”参数以添加多语言支持。 现在问题是当尝试注册它时返回此错误:

<a href="#my_div_id">My Div</a>

...

<div id="my_div_id">Content here</div>

我的路由器是:

Some mandatory parameters are missing ("lang") to generate a URL for route "eartman_designer_registration_confirm".

和注册路由器是:

  eartman_designer_security:
        resource: "@EartmanDesignerBundle/Resources/config/routing/security.yml"
        prefix: /designer/{lang}

    eartman_designer_profile:
        resource: "@EartmanDesignerBundle/Resources/config/routing/profile.yml"
        prefix: /designer/{lang}/profile

    eartman_designer_register:
        resource: "@EartmanDesignerBundle/Resources/config/routing/registration.yml"
        prefix: /designer/{lang}/register

    eartman_designer_resetting:
        resource: "@EartmanDesignerBundle/Resources/config/routing/resetting.yml"
        prefix: /designer/resetting

    eartman_designer_change_password:
        resource: "@EartmanDesignerBundle/Resources/config/routing/change_password.yml"
        prefix: /designer/{lang}/profile
    eartman_designer_design:
        resource: "@EartmanDesignerBundle/Resources/config/routing/designer_design.yml"
        prefix: /designer/{lang}/design

如何将lang参数传递给注册?????

1 个答案:

答案 0 :(得分:2)

检查vendor / friendsofsymfony / user-bundle / Mailer中Mailer.php中的sendConfirmationEmailMessage函数,并将lang参数添加到此函数