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

Member

braeden

by braeden , in category: Technology , 2 months 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 , 2 months 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