#Yii Solution: Yii::app()->getBaseUrl() is returning empty string


Updated May 8, 2016 ● 5,516 views

While coding one of my projects, I encountered the need to get the base url of my website. Apparently, Yii::app()->getBaseUrl() is returning an empty string.

To resolve this issue, I just passed true as a parameter:

<?php echo Yii::app()->getBaseUrl(true);?>

Follow Yii Channel for more Yii PHP Framework tips!

0 Comments