N
N
Nikita Samokhvalov2015-03-24 13:08:22
Yii
Nikita Samokhvalov, 2015-03-24 13:08:22

How to connect one module in different applications built on Yii 2 Advanced Application?

The project is based on Yii advanced . There are three applications: api, backend and common.
Question 1. Is it correct to place an API module in a common application? I want to do this in case you need to use, for example, models not only in the api application, but also in the backend.
Question 2. If the module will be placed in the common application, how to connect it from the api application?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan, 2015-03-24
@IvanCher

1. Make the API better as a separate application, and create common models in common.
2. Cofig files in applications should be merged with the common application config, so write the module in the common application config and the module will be available in any.

V
vyachin, 2015-04-08
@vyachin

1. Is your API made as a module or as an application? If as an application, then it is already independent of other applications. If as a module and you intend to use it on the backend and frontend, then of course in common it is the place.
2. www.yiiframework.com/doc-2.0/guide-structure-modul...

[
    'modules' => [
        'api' => [
            'class' => 'common\modules\api\Module',
        ],
    ],
]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question