Incorrect Controller Names Cause CodeIgniter 404s

CodeIgniter

It’s just a convention, right?

WRONG!

Due to the way Windows and Linux servers treat capital letters, you could be opening yourself up for a world of deployment pain or system moves if you have mixed landscapes.

What’s The Convention?

Capitalise the first letter. All others lowercase.

Examples:

  1. Home
  2. Aboutus
  3. Mymenus
  4. Contactme

Now, there’s the temptation on two-word controller names to capitalise the first letter of the second word. For example:

  1. AboutUs
  2. ContactUs

I’ll be honest, I’d personally like to do that but… DON’T!

Windows it’ll all be fine. Linux servers will start showing 404 pages. This is certainly a frustrating error to debug and by keeping to the convention of only capitalising the first letter of the controller – no matter how many words are in the controller name – you’ll save yourself a world of pain!

You may also like...

0 0 votes
Article Rating
Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x