controllers/actions: protected/controllers/$ControllerID.php;
models: protected/models/$modelClassID.php;
views: views/$controllerID/$actionID.php.
It seems this directory organization clearly splits the MVC parts. But in fact they are tightly coupled in logic: controllers/actions refers to views and models, views incorporates model class attributes. Everytime navigating the code logic to invoke models/views, you have to guess the file locations to open the files.
I think taking the following style can make it simpler, when you are learning/working on Yii:
controllers: 'protected/'.$controllerID.'/'.$controllerID.'.php'
actions: 'protected/'.$controllerID.'/'.$actionID.'.php'
models: 'protected/'.$controllerID.'/'.$modelClassID.'Model.php'
views: 'protected/'.$controllerID.'/'.$actionID.'View.php'
common/shared: 'protected/models', 'protected/layouts', 'protected/views'
components: same as controllers
For example, a controller named 'site' with action 'login', model 'LoginForm' and view are as follows:
protected/site/site.php
protected/site/login.php
protected/site/LoginFormModel.php
protected/site/loginView.php
The above naming conventions can easily be linked to the requesting URL: '?r=site/login'. And you will never be lost in the editor with same name files (Does the tab name 'login.php' refer to the action or the view?). I know Yii directory can be dynamically configured. But the filenames are not. So I strongly want to hear the voices from Qiang and you people. Thanks!