Filenaming Convention in Controllers.

Hi, i recently just found a problem with file naming convention of controllers. Naming like HelloWorldController.php does not work on my fedora apache server but work for my window apache server. Upon changing to HelloworldController.php, it works wonder. I not too sure is it my setting main.php or flaw in the framework. I just tested in controller, not too sure whether other components file naming is affected as well.

Please advise. Thank you.

What errors are you getting?

Have you generated that class using Gii? What have you used in Gii "HelloWorldController" or "HelloworldController"?

If you name the file HelloWorldController.php is the class named HelloWorldController?

I have got 404 error. i didn’t generate the code from gii. I simply create a class like the following:




class HelloWorldController extends CController

{

  public function actionIndex() {

    echo 'hello';

  }

}



without changing the class name, i just change HelloWorldController.php to HelloworldController.php, it works…

I just tryed your code on OpenSuSe 11.3 and Windows XP

I created the HelloWorldController.php (copyed your code above)

It works the same on both systems…

calling yiiapp/HelloWorld - displays "hello"

calling yiiapp/Helloworld - gives 404 error

Could be something with urlManager rules in the main.php…

I guess is case sensitive file system.

Be sure that the file and the class has the same name, or you will get the error.

If you have the possiblity, the next time you will format your windows choose a case sensitive file sistem, that will avoid really unpleasent problem at release moment.

The files are tested on fedora 13 and centos 5.3, both have the same issue. My main.php is configure showScriptName=false, caseSensitive=false.

This issue is minor to me, just share my thought on this problem I found out.

Thanks for the quick replies.

I have experienced this as well, good time vampire…