FOSRestBundle icon indicating copy to clipboard operation
FOSRestBundle copied to clipboard

symfony controller method action suffix

Open stijn-at-work opened this issue 4 years ago • 3 comments

We are upgrading our app to Symfony 4. The Symfony docs state that the action suffix is no longer needed for controller method names.

The first Symfony versions required that controller method names ended in Action (e.g. newAction(), showAction()). This suffix became optional when annotations were introduced for controllers. In modern Symfony applications this suffix is neither required nor recommended, so you can safely remove it.

Our controller methods extend AbstractFosRestController.

When removing the Action suffix and run bin/console debug:route, I get an error.

Are you planning to update the source code to comply with this Symfony recommendation?

stijn-at-work avatar Aug 30 '21 10:08 stijn-at-work

When removing the Action suffix and run bin/console debug:route, I get an error.

Which error do you get and which version of FOSRestBundle do you use?

W0rma avatar Sep 03 '21 05:09 W0rma

This is probably not an issue with FOSRestBundle. All my controller methods do not have an action suffix and they work just fine

InjustFr avatar Sep 14 '21 06:09 InjustFr

@stijn-at-work since a lot time have past, do you have still the same experiencie with Symfony 5 or 6 version?

shakaran avatar Aug 04 '23 17:08 shakaran