Skip to content

[2.2] Importing Routes (Prefix issue) #4322

Closed
@trsteel88

Description

@trsteel88

Say I import the following route:

app/config/routing.yml

AcmeBusinessBundle_client:
    resource: "@AcmeBusinessBundle/Resources/config/routing/client.yml"
    prefix:   /clients

...Resources/config/routing/client.yml

acme_business_client_list:
    pattern:  /
    defaults: { _controller: AcmeBusinessBundle:Client:list }

acme_business_client_create:
    pattern:  create
    defaults: { _controller: AcmeBusinessBundle:Client:create }

The route comes through as follows:

php app/console router:debug

acme_business_client_list   ANY    /clients/
acme_business_client_create ANY    /clients/create

Which means there is no way to make the route just /clients for the list page.

This also creates an issue when adding a _format requirement.

Take the following for example:

acme_business_client_list:
    pattern:  /.{_format}
    defaults: { _controller: AcmeBusinessBundle:Client:list }

acme_business_client_create:
    pattern:  create
    defaults: { _controller: AcmeBusinessBundle:Client:create }

Now it comes through as:

php app/console router:debug

acme_business_client_list   ANY    /clients/.json
acme_business_client_create ANY    /clients/create

Is there any kind of work around for this besides importing the list route on its own?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions