/**
* Creates an absolute URL to a published asset. Eg: '/path/to/hash/asset.gif?cachebusted'
* @param string $path The path to the asset. Eg: 'img/cat.gif'
* @param string $basePathAlias The alias path to the base location of the asset.
* Eg: 'application.modules.mymodule.assets'
* @return string The absolute path to the published asset.
*/
public function createUrl($path = null, $basePathAlias = null, $bustCache = true)
{
$basePath = '';
if ($basePathAlias !== false) {
$basePath = $this->getPublishedPathOfAlias($basePathAlias) . '/';
$url = $basePath . $path;
} else {
$url = Yii::app()->createUrl($path);
}
if ($bustCache) {
$url = $this->cacheBuster->createUrl($url);
}
return $url;
}