Answer the question
In order to leave comments, you need to log in
How to store common models and business logic for multiple projects?
There are several different Yii2 projects in different repositories, but there are places where they can use the same business logic and AR. Where is the best place to move these components so as not to duplicate them in each repository? Are there other options besides creating an extension?
Answer the question
In order to leave comments, you need to log in
We did this at work. All projects are stored in one folder on the server, both on the test and on the production one. In it, a separate project was created with common models and components, namespaces were configured:
In the project where these common models are needed, we prescribe the appropriate alias for them:
$config = [
...
'aliases' => [
'@common' => dirname(__DIR__) . '/../common'
]
...
];
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question