New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Firewall] No routing and locale support #861
Comments
The "?" placeholder there is in fact regular expression paths, and not routing related. Therefore you should use something like: |
@Seldaek the issue is that the login_path is used to redirect the user (as for default_target_path). It is not a regular expression |
How can i determine if it should be |
Ah sorry, I guess I misunderstood your question. This is indeed a problem for which there is no good solution atm I'm afraid. What you can try is this: account:
pattern: /{_locale}/account
defaults: { ... }
_post_login:
pattern: /account
defaults: { _controller: FrameworkBundle:Redirect:redirect, route: 'account' } That way if all goes well if you point the target_path to /account, it will redirect and use the session's locale to generate the url to /xx/account. The other solution, that's maybe less hackish, would be to specify the "_target_path" (iirc) as a hidden form field in your login form, and generate the proper url based on the current locale. |
Thanks for the workaround. I will try the redirection approach as it seems more controllable. Should i leave this open as a a feature request? |
Make sure it works before thanking me ;) As for the feature, considering the configuration value is only a default and the actual value should be given in the form, I guess yes, if it's solved for you you can close this, and if you feel like being real nice you could head to https://github.com/symfony/symfony-docs and submit a pull request to improve the docs about this :) |
{_locale} can now be used as placeholder in the target path. |
@schmittjoh looks like this code was never merged? Also I think you're misusing strtr() there, it should be |
Simple use-case:
and
The backrouting is very limited. Neither will work for the
?
placeholder:/{_locale}
,frontpage
,/{_locale}/login
.I'm new to Symfony maybe im missing something but my general understanding from the docs was that routing is the main component that all other should rely on. This seems like a serious limitation for localized sites as I need to route the user through the
languageselector
route to get him back to the frontpage (or any localized page).The text was updated successfully, but these errors were encountered: