Why does the following codes generate different pathes for assets?
// this one generates: "/assets/ad422429/xajax_js/xajax_core.js"
$objCs = Yii::app()->clientScript;
$strFile = CHtml::asset(Yii::app()->getBasePath().'/extensions/xajax/xajax_js/xajax_core.js');
$objCs->registerScriptFile($strFile);
// this one generates: "/assets/ad422429/xajax_core.js"
$strFile = Yii::app()->getBasePath().'/extensions/xajax/xajax_js/xajax_core.js';
$strFile = Yii::app()->getAssetManager()->publish($strFile);
In the second code example is the dir "xajax_js" missing. In my extension I have to generate the asset with the second piece of code, but I need the xajax_js dir to be generated, like in the first piece of code.
What is the trick?