When to use components and when to use extensions in Yii?

微笑、不失礼 提交于 2019-12-03 01:22:01

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!