Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

New #[Route] attribute parameteralias doesn't work with prefix? #60595

Open
@alcohol

Description

@alcohol

Symfony version(s) affected

7.3.0

Description

I'm trying to use the newalias introduced on the#[Route] attribute in 7.3, but getting unexpected results.

How to reproduce

with configuration

# config/routing.yamlgeneral:resource:'../src/Controller/'type:attributeprefix:nl_NL:/nl_BE:/fr_FR:/fr_BE:/fren_US:/host:nl_NL:'%nl_host%'nl_BE:'%be_host%'fr_FR:'%fr_host%'fr_BE:'%be_host%'en_US:'%en_host%'

using

#[Route(path: ['nl_NL' =>'/','nl_BE' =>'/','fr_FR' =>'/','fr_BE' =>'/','en_US' =>'/',], name:'default', methods: ['GET'], alias: ['my-alias'])]

yieldsTarget route "default" for alias "my-alias" does not exist. from the template where i try to generateurl(app.current_route)

but using

#[Route(path:'/', name:'default', methods: ['GET'], alias: ['my-alias'])]

yieldsUnable to generate a URL for the named route "my-alias" as such route does not exist. later on in the same template when trying to generateurl('my-alias')

Possible Solution

No response

Additional Context

No response

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


      [8]ページ先頭

      ©2009-2025 Movatter.jp