Hi,
I’m creating a widget and I’m using assorted assets along with it. When I publish the script files like so:
//make the asset path availiable.
$path = pathinfo(__FILE__);
$basePath = $path['dirname'].DIRECTORY_SEPARATOR.'assets';
$baseUrl=Yii::app()->getAssetManager()->publish($basePath);
//register the needed scripts and default css files
$cs=Yii::app()->getClientScript();
$cs->registerCoreScript('jquery');
$cs->registerScriptFile($baseUrl.DIRECTORY_SEPARATOR.$this->scriptFile, CClientScript::POS_HEAD);
$cs->registerCssFile($baseUrl.DIRECTORY_SEPARATOR.$this->defaultCssFile);
I get this in the source of my page:
<link rel="stylesheet" type="text/css" href="/HydroRecoveryLP/admin/assets/61ba992d/defaultDraggableMultiSelect.css">
<script type="text/javascript" src="/HydroRecoveryLP/admin/assets/61ba992d/draggableMultiSelect.js"></script>
<script type="text/javascript" src="/HydroRecoveryLP/admin/assets/6592c0d0/jquery.js"></script>
This is fine and correct except the 61ba992d directory doesn’t exist under my assets folder. Shouldn’t that be created by the assets manager or do I have to create it myself? I thought that publish() created the necessary directory and copied the files there for me.
The file permissions on the assets directory are correct (readable and writable) so if publish does do the copy it should work.
Any thoughts or comments?
Thanks,
-Nazum