What Rules do you follow at the time of creating methods within the controller in Symfony?

Member

by braeden , in category: Technology , 3 years ago

What Rules do you follow at the time of creating methods within the controller in Symfony?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by adolf , 3 years ago

General rules for creating a method in within the controller in Symfony.

  • Only action methods should be public.
  • Controller methods should be short; if your controller is long, consider refactoring it.
  • Action methods must have the “Action” suffix
  • Action methods should return a valid response object