Answer the question
In order to leave comments, you need to log in
What is the correct way to configure Yii2 to get a submodule relative URL?
I use the modular structure of the application, allocating a separate module for each group of tasks with everything that follows in its filling. If there is a first-level module, everything is relatively simple, register it in the application config and you can use something like this anywhere:
But as soon as the task of registering the module as a submodule with different configuration to get different data sets when using common methods, I get a problem with getting relative URLs for a submodule:Url::to(['default/index']); // user/default/index
Url::to(['rules/default/index']); // admin/user/rules/default/index вместо admin/rules/default/index
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question