create a shortcut for it as you will have to write it a lot of times
/**
* This is the shortcut to Yii::app()->request->baseUrl
* If the parameter is given, it will be returned and prefixed with the app baseUrl.
* @return string
*/
function bu($url=null){
static $baseUrl;
if ($baseUrl===null)
$baseUrl=Yii::app()->getRequest()->getBaseUrl();
return $url===null ? $baseUrl : $baseUrl.'/'.ltrim($url,'/');
}
then just use bu(‘myUrl’) that will return subfolder/myUrl