Friday 21 February 2014
Friday 7 February 2014
How to show protected images in Yii
"protected" folder are not accessible from the client browser. This prevents user to have access to important files. If you want to store images inside "protected" and want them to be accessible, you need to publish them using CAssetManager.
Example:1 2 | $path = Yii::app()->basePath.'/path-inside-protected'; $imgurl= Yii::app()->assetManager->publish($path); |
1 | <img src="<?php echo $imgurl?>"> |
Subscribe to:
Posts (Atom)