This is an extension to Yii 2.0: Write & use a custom Component in Yii2.0 for Advanced Template
This is an extension to Yii 2.0: Write & use a custom Component in Yii2.0 for Advanced Template
In Yii1 I used to have my own components under the components folder of the structure, now with namespacing this is a little bit different.
This is a simple example in Yii2.0 to understand how you can write a custom component and use it inside your app.(basic template)