Asset Access in view file

In my view file I want to show an image from the asset directory (with the hash codes in the url)

When I register the asset class then I can use the baseurl

However that also seems reloads the css/js files that were already loaded (hence changes my css look)

Is there any way how I can access the image with the hashcode ? without re-registering the asset bundle

I have registered the asset bundles in my layout to keep my views as thin as possible.

Hi,

Have you tried to register the image alone?

May be this code will help u




Yii::app()->getAssetManager()->publish(Yii::getPathOfAlias('imgLocation.assets')) . '/images/YOUR_IMAGE_NAME.png';