Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Routing] Support for env variables when configuring locale based on host #38210

Closed
@Wirone

Description

@Wirone

Description
I've followed #30617 (and symfony/symfony-docs#13571) for configuring support for locales based on host. Unfortunately, it does not support for env variables for hosts and in my opinion it makes this feature unusable, non-friendly at least:

  • routes must be defined differently for DEV and PROD
  • moving app between domains requires changes in codebase

Would be great if hosts could be passed as env variables.

Example

foo:
    resource: routes/foo.yaml
    prefix: /
    defaults:
        _format: html
    host:
        en: '%env(APP_HTTP_HOST)'
        pl: '%env(APP_HTTP_HOST_PL)'

With config above it does not work, even considering #38209 is fixed and host-related rules are checked.


CC: @odolbeau

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions