Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Difference in between Modules and extension in Yii

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.

like image 257
NewUser Avatar asked Dec 08 '11 14:12

NewUser


People also ask

What is module in Yii?

A module is an entity that has its own models, views, controllers, and possibly other modules. It is practically an application inside the application. Step 1 − Create a folder called modules inside your project root. Inside the modules folder, create a folder named hello.

What is difference between Yii and Yii2?

Conceptually Yii1 and Yii2 are quite similar, however Yii2 runs on newer PHP versions and utilizes namespaces, traits etc. Yii2 has also support for dependency injection through $container singleton available after initializing the framework.

How long does it take to learn Yii?

Basics - can take days, weeks or years. ;) Yii - Step 1 & 2, takes a few hours. The rest takes days, or a few weeks if you're doing things parttime. After all that, you should go into the depths of building your own custom Yii stuff!

Is Yii Framework easy to learn?

As @samdark said, Yii is easy to learn and use but you need some previous knowledge. My advice is going step by step through the official documentation doing some test project. In a couple of months you will be able to do useful stuff.


Video Answer


1 Answers

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:

  1. application component
  2. behavior
  3. widget
  4. controller
  5. action
  6. filter
  7. console command
  8. validator: a validator is a component class extending CValidator.
  9. helper: a helper is a class with only static methods. It is like global functions using the class name as their namespace.
  10. module
  11. something else
like image 69
Oleg Avatar answered Oct 23 '22 01:10

Oleg