• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Controllers...plural or singular?

#4
[eluser]brianw1975[/eluser]
I base my controller names on how I want the URL to look. I also tend to group "index" pages as plural and detail pages as singular (If the page is going to display more than one record then the controller should be a plural).

To keep the number of files relatively low I use routes to call the necessary controller. Having users/ and user/x in the same controller.

Another way to think about it (at least in my logic) is that a singular name indicates the end of filtering through data, whereas plural names indicate that you are still filtering.

But, to each their own.

Personally, unless you are looking to redistribute your code, I wouldn't worry about it too much.


Messages In This Thread
Controllers...plural or singular? - by El Forum - 08-24-2009, 08:53 AM
Controllers...plural or singular? - by El Forum - 08-24-2009, 09:21 AM
Controllers...plural or singular? - by El Forum - 08-24-2009, 10:11 AM
Controllers...plural or singular? - by El Forum - 08-24-2009, 11:58 AM

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.