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

Skip to content

Controller actions ending with words like "action" are removing the "action" part from route name #40024

Closed
@moynzzz

Description

@moynzzz

Symfony version(s) affected: All

Description
If you have in a controller some action like this one:

/**
 * @Route("/create-transaction")
 */
public function createTransaction()
{
    // Code here
}

Then if you have to generate a route the action name will be app_controller_createtrans. If you want to have a proper action name like app_controller_createtransaction you should have the name of the action to createTransactionAction.

I know this is not exactly a bug and we can introduce a BC. It will be better for newcomers if the automatic name is the same as the method name except if it ends with an Action with capital A. WDYT? If someone decides that this should be done I want to propose a PR.

Possible Solution

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