0

My problem is quite strange. I'm developing CakePHP application. At the beginning I was doing all stuff on my local server with Windows... and works pretty good. But now I had to do upload to company's server. Now the app doesn't work due to CamelCase convention. My filenames looks like this: PostCategoriesController. On local Windows server there's no problem. But after upload when I type web address in my browser I see PostcategoriesController could not be found. I know Windows and Linux are case-sensitive in different ways. However in Cookbook we can read that developers should use CamelCase convention, so what I'm doing wrong?

VIPPER
  • 326
  • 4
  • 24
  • 2
    You've probably made a mistake somewhere like using `postcategories` instead of `post_categories` in the URL or in a route... – ndm Aug 01 '14 at 13:19
  • yea, in URLs I'm using postcategories without underscore, but on local server it works... Anyway, thanks for help :) – VIPPER Aug 01 '14 at 14:48
  • Ok, let me add that as an actual answer so that this question appears resolved... – ndm Aug 01 '14 at 15:18

1 Answers1

1

As figured in the comments, you were using postcategories instead of something like post_categories in the URL, and so CakePHP cannot properly inflect this to PostCategories as there is no separator for the the words, and so you'll end up with Postcategories, which only works only Windows systems as its filesystems are case-insensitive (except for NFS on some server version if I remember correctly).

See also Cookbook > CakePHP conventions > URL Considerations for Controller Names

As can be seen in the docs it's also possible to use uppercase chars to indicate multiple words, ie postCastegories or PostCategories would work in a URL too.

ndm
  • 59,784
  • 9
  • 71
  • 110