I just have added a new application at my yii2-app-advanced based project. I don’t want to go into the details - it is the common structure so I have an own namespace called api, a single contoller and some config and view files.
I just would like to know if it is required to add an alias into common/config/bootstrap.php (another place might also be possible, of course)? Because without, the controller could not be found, though controllerNamespace was api/controllers what should be correct. Only if I add an alias (Yii::setAlias(’@api’, dirname(dirname(DIR)) . ‘/api’);) the controller gets found. The controller is in namespace api/controllers.
So is it required to ad an alias? I’m wondering about this…