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


Updated May 8, 2016 ● 5,527 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


This website uses cookies. By continuing to use this site, you are accepting our Privacy Policy and Terms of Service.