问题
I'm a little bit confused about the purpose of components and extensions folders in protected/
Please clarify.
回答1:
According to my little experience on Yii:
Components are the classes which can help you write the business logic on the basis of your models. You definitely don't want to code all of your work in controllers, then you need the component to distribute your code and call it in controller.
Extensions are like the libraries, which basically are not dependent on your models, and hence can be reused anywhere in current or later projects. For example: an email extension, or a class that send tweet to your twitter account.
It may be different for other coders/users.
来源:https://stackoverflow.com/questions/8426170/when-to-use-components-and-when-to-use-extensions-in-yii