8000 [Routing] doc for env() function in route condition by GromNaN · Pull Request #16610 · symfony/symfony-docs · GitHub
[go: up one dir, main page]

Skip to content

[Routing] doc for env() function in route condition #16610

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

Merged
merged 1 commit into from
Mar 25, 2022

Conversation

GromNaN
Copy link
Member
@GromNaN GromNaN commented Mar 16, 2022

Fix #13247 for symfony/symfony#35747

Very useful to match host based on env var.

blog_list:
    path: /blog
    # the controller value has the format 'controller_class::method_name'
    controller: App\Controller\BlogController::list
    condition: "context.getHost() == env('APP_MAIN_HOST')"

@javiereguiluz
Copy link
Member

Jérôme, thanks a lot for providing this missing doc!

@GromNaN GromNaN deleted the patch-2 branch March 25, 2022 16:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Routing][FrameworkBundle] Allow using env() in route conditions
4 participants
0