Creating modules

After creating a module using YIIC it gives the following message:

Now, where exactly is the "application configuration" ?

Found it!


Added for my admin module:


Ok… moving on further

Accessing my new admin module in my browser no problem:


Ok, so lets create a model and CRUD in admin for my "labels" table in the database:

>> model admin.Labels

   generate models/Labels.php

   generate fixtures/Labels.php

   generate unit/LabelsTest.php

The following model classes are successfully generated:


If you have a 'db' database connection, you can test these models now with:



So far so good, next:

>> crud admin.Labels

   generate LabelsController.php

   generate LabelsTest.php

      mkdir C:/wamp/www/yii/protected/modules/admin/views/labels

   generate create.php

   generate update.php

   generate list.php

   generate show.php

   generate admin.php

   generate _form.php

Crud 'labels' has been successfully created. You may access it via:


So, lets see if we can access admin/labels at: http://localhost/yii/index.php?r=admin/labels


PHP Error


include(Labels.php) [<a href='function.include'>function.include</a>]: failed to open stream: No such file or directory

I am using yesterday’s SVN. Is this a bug, or have I done something wrong?

You need to make sure you have imported the models directory that contains the Labels class.

Ok, great!

For the benefit of others, in /protected/config/main.php:

	// autoloading model and component classes




		'application.modules.admin.*',  // added this line