but when i add a new file for example css file to widget assets a new hash folder created in application assets though previous widget asset file doesn’t override or removed!
// code from rights extension ;
private $_assetsUrl ;
public function getAssetsUrl()
{
if( $this->_assetsUrl===null )
{
$assetsPath = Yii::getPathOfAlias('rights.assets');
// We need to republish the assets if debug mode is enabled.
if( YII_DEBUG )
$this->_assetsUrl = Yii::app()->getAssetManager()->publish($assetsPath, false, -1, true);
else
$this->_assetsUrl = Yii::app()->getAssetManager()->publish($assetsPath);
}
return $this->_assetsUrl;
}
do you see the trick :
if in debug mode (means you often add or remove or update some js/image/css files ) , you should publish the dir every time . but if YII_DEBUG set to false . it will only publish once
tHr, you have extensions that help you in cleaning assets, like this one
yiqing95, In fact, even without forcing republishing of assets, they will be republished under a new hash if the original application/assets/ folder’s timestamp is modified. And that’s by design, and we need it like that indeed