Getting base URL in Yii 2
I am trying to get the base URL for the project in Yii 2 but it doesn't seem to work. According to this page you used to be able to do:
Yii::app()->getBaseUrl(true);
In Yii 1, but it seems that that method in Yii 2 no longer accepts a parameter?
I've tried doing it without true, such as:
Yii::$app->getBaseUrl();
But it just returns empty.
How can you do this in Yii 2?