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

devquora
devquora

Posted On: Apr 22, 2024

 

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

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    Symfony Interview Questions

    What is Symfony?

    Symfony is a set of PHP Components and leading PHP framework to create websites and dynamic web applications.It follows..

    Symfony Interview Questions

    Is Symfony is open sourced Framework?

    Yes, Symfony is open sourced Framework released under the MIT License. You can download it free from https://symfony.com..

    Symfony Interview Questions

    What is the latest version of Symfony?List server requirements to install it?

    Symfony 3.4 is the latest version of Symfony.To install and run Symfony 3, your server must fulfill following requirements..