extensions vs modules

Hey guys -

Is there a substantive difference between "extensions" and "modules"? Are they treated differently or are they just different directories for managing the same thing?


a module is a sub-application with controllers, models, views

I use modules for backend applications, facebook etc

an extension can be anything, have a look at the extensions repository

… and a module can have its own extensions (since as mbi pointed out, it’s basically a application. CApplication actually inherits CModule)

… and a module can be an extension ;)

I’m having problems getting any module to work. I tried creating my own using the yiic and I also downloaded the yiiShop extension. This seems like it should be fairly straight forward but every attempt to access the pages gets me a page not found error. Does anyone have a simple example of a site that uses a module that I can test and look over. Everything else about my site works so I’m not sure what is wrong. Any help would be appreciated.

Probably you’ve forgot to list your modules in the application’s config:

return array(


  'modules' => array('foo')



My advice is not to use the yiic tool as a beginner. It’s ok to generate a sample application with it, but … try to rewrite everything by hand and only use the automatically generated application as a reference.

You’ll be amazed how many details passed by unobserved. As such, you should learn Yii faster. It will be frustrating on the short term, but on the long run it’ll pay.

The first step to learn this way is trying to get a working application with no view, layout and such fancy stuff, just with a controller and a config.

Then simply add stuff incrementally, as you see fit.

thanks for the reply. for the most part I’ve just started to recreate the blog tutorial manually. Other than creating the site itself, the module is the only thing I’ve used the yiic for. The rest of my site works fine and I haven’t had much problem getting new stuff to work. As far as I can tell everything looks correct. The only thing I think it can be is that my yii application isn’t on the root of the website. I’m on a windows box and my root path for the webserver is like c:\phpapps and my yii stuff is under this at c:\phpapps\yii\sites\website. Everything else seems to work fine so I don’t know why this would make a difference. Should it?

I’m going to try and start over by creating an empty site and just adding a module and see if this fixes the problem.


I was using the UrlMapper in my config settings. I guess once you start using this any new pages/modules that are added must be included in the UrlMapper array. I removed this from the config and now it works.