Problems with themes in a multisite project yii2

Hi guys,

I have a problem with one thing that I am trying to do.

I have a multi-site project in yii2. Depending on the domain that is accessed, one theme or another is loaded within the views. The problem is that there are files in both themes that are identical and I do not want to modify the same file many times. My solution would be to delete the files of all the subjects less than one and from the base controller, make a method that is responsible for seeing if that file that is going to render exists and if it does not exist then go to the path where the main theme is and I loaded it from there. The big problem is that I do not know how to do it. Let’s see if someone can help me.

A greeting.

http://www.yiiframework.com/doc-2.0/guide-output-theming.html#theme-inheritance

Thank you very much, my friend! You just saved my life! :)