Skip to content

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

@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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy