Hi Veera,
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:
/webserver_directory/project_name/protected/config/main.php
Then, in that file I found the modules section and added the new module name "users" to it:
‘modules’=>array(
// uncomment the following to enable the Gii tool
'gii'=>array(
'class'=>'system.gii.GiiModule',
'password'=>'*****',
// If removed, Gii defaults to localhost only.
'ipFilters'=>array('127.0.0.1','::1'),
),
// Must have or shell command will not put files in module.
'users'=>array(),
),
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.