I have a yii2 advanced template project and has 4 main modules.backend,frontend,api and common.
I have recently created a component in common which has 2 3 function in it.Main method is sendMessage which uses another method in same class which is findModel($id).
When i access this component from backend i can access that component with following line
Yii::$app->myComponent->sendMessage()
but i cant use the same code in api module.
Is there a specific reason for that or is there another way to access all those component methods in api module from common component.
I have created a restful api in that api folder.
common/config/main.phporbackend/config/main.php? And does your api-config merge with common-config?common/config/main.phpbut i dont know how to mergeapi-configwithcommon-config. I have addedapiincommon/config/aliases.php. Can you give me an example of how to merge? Thank you