The UFactory::getModuleAlias()
method should not be called statically. This is because the method relies on the $module
property, which is not set when the method is called statically. As a result, the method will return null
.
To fix this, you can use the following code:
``` $module = Yii::$app->getModule('module-name'); $alias = UFactory::getModuleAlias($module); ``` This code will first get themodule-name
module from the application and then use the module to get the module alias.