I'm a little bit confused about the purpose of components and extensions folders in protected/
Please clarify.
Yii applications are built upon components which are objects written to a specification. A component is an instance of CComponent or its derived class. Using a component mainly involves accessing its properties and raising/handling its events. The base class CComponent specifies how to define properties and events.
Yii is the first choice of the developers over the other PHP frameworks because of its developer-friendly features. Its features are secure, reliable, and easy to configure. It is ideal for websites and web apps that are having high traffic for example web portals, eCommerce portals, or CMS Websites.
The Benefits of Yii2 Development Like Symphony and Laravel, Yii2 is an open-source framework for both back-end and front-end programming. A lot of explanatory documentation helps to sort out many issues and the framework is also supported by a community of significant size. Yii also supports Object-Relational Mapping.
Applications are objects that govern the overall structure and lifecycle of Yii application systems. Each Yii application system contains a single application object which is created in the entry script and is globally accessible through the expression \Yii::$app .
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With