I just ran into the same problem you had when trying to use gii or yiic shell to create a controller for
a module. The above posts give accurate help but missed one step.
You must set your yii web application configuration file to include the module your are building.
I believe this is the problem you are having.
For example, I built a module called "users". Then, I wanted to build a controller for that module.
Before building the controller I first went to the application configuration file:
Then, in that file I found the modules section and added the new module name "users" to it:
// uncomment the following to enable the Gii tool
// If removed, Gii defaults to localhost only.
// Must have or shell command will not put files in module.
Notice, the module section of your config file is also where your gii configuation is.
You need to add the ‘users’=>array(), to the modules=>array. After making this change,
you can use yiic shell or gii to create a controller for the module and it will place
the controller and view files in the module. If you skip this step the controller and view files made
by gii or yiic shell will be placed in the regular controller and view folder instead of the
module’s controller and view folders.
Code to make a module controller in yiic shell.
module users/users login logout listUsers manageUser
I hope this helps.