M Gholami
M Gholami

Reputation: 971

how to pass some parameter to fosuserbundle in symfony

I am using fosuserbundle for user managment in my website . it work correctly , but I need to add "lang" parameter to fos routers to add multi language support. now the problem is when try to register it returns this error:

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

my router is:

  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

and registeration router is:

eartman_designer_registration_register:
    path: /
    defaults: { _controller: "FOSUserBundle:Registration:register" }

eartman_designer_registration_check_email:
    path: /check-email
    defaults: { _controller: "FOSUserBundle:Registration:checkEmail" }
    methods: "GET"

eartman_designer_registration_confirm:
    path: /confirm/{token}
    defaults: { _controller: "FOSUserBundle:Registration:confirm"}
    methods: "GET"

eartman_designer_registration_confirmed:
    path: /confirmed
    defaults: { _controller: "FOSUserBundle:Registration:confirmed" }
    methods: "GET"

how can I pass lang parameter to registration?????

Upvotes: 3

Views: 957

Answers (1)

sajjad
sajjad

Reputation: 666

check sendConfirmationEmailMessage function in Mailer.php in vendor/friendsofsymfony/user-bundle/Mailer and add lang parameter to this function

Upvotes: 2

Related Questions