CodeIgniter Forums
Controller File Name? - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Controller File Name? (/showthread.php?tid=68425)



Controller File Name? - Nubster - 07-09-2017

I'm just starting CI on Linux and I notice that I cannot get a Controller to work properly unless the Controller file name begins with a capital letter.  IOW, a controller named "Home" will not work unless the controller's file name is "Home.php".

I've tried different combinations of "Home" and "home" for the Controller name and different combinations of "Home.php" and "home.php" for the Controller's file name.  The only file name that works is "Home.php.

I'm just trying to see if there is way to keep all file names lowercase - which is a convention I've been using for years...

Any clarification would be appreciated.

Thank you in advance.


RE: Controller File Name? - ciadmin - 07-09-2017

Controller filename and class names must be UCfirst, i.e. start with a capital letter and then have the rest lowercase.

https://www.codeigniter.com/user_guide/general/controllers.html


RE: Controller File Name? - arisroyo - 07-09-2017

I understand you, but it's a coding standard that we follow here for CI.


RE: Controller File Name? - InsiteFX - 07-10-2017

Things change and you need to be open minded to change.

We all had to make these changes but for the most part they are for the good.