I want to know what is the difference in between modules and components in Yii Framework. I have googled so much but not got any good results. So can some one will help me out to know that. Any help and suggestions will be highly appreciable.
Asked
Active
Viewed 5,165 times
16
3 Answers
8
Module has an MVC structure. A module is a self-contained software unit. Module is a special case of extension. An extension usually serves for a single purpose. In Yii's terms, it can be classified as follows:
- application component
- behavior
- widget
- controller
- action
- filter
- console command
- validator: a validator is a component class extending CValidator.
- helper: a helper is a class with only static methods. It is like global functions using the class name as their namespace.
- module
- something else

Oleg
- 7,070
- 4
- 47
- 49
0
Extensions may actually be modules but sometimes aren't. A module contains models, views, and controllers while an extension may only be something like a widget.

brpyne
- 996
- 9
- 14
-
Extension can't be a module anyway. – Oleg Dec 09 '11 at 19:49
-
1Here's an example of an extension that's a module. http://www.yiiframework.com/extension/yii-user-management/ – brpyne Dec 09 '11 at 20:04
-
I'm sorry. The module - is a special case of extension. – Oleg Dec 09 '11 at 20:15
0
I guess Yii extension is under protected/extensions directory and for single purpose, it can never be a module. Modules are under protected/modules directory. Those extensions on yii offical website and extensions in yii MVC framework are not the same.

zuo
- 1,061
- 1
- 12
- 27