sacpv04
(Sacpv04)
February 27, 2014, 4:00pm
1
Dear all,
I want to display an image but the problem that Yii can not show jpg image, what is the reason ?
here is my code :
<img src="<?php echo Yii::app()->baseUrl.'../images/icon_add.jpeg'; ?>" />
<img src="<?php echo Yii::app()->baseUrl.'../images/head.jpg'; ?>" />
on 2 lines above, it just display jpeg image.
bagwari65
(Manish)
February 28, 2014, 4:54am
2
hi, check ur reqirement…like
http://hostname/path/to/yii/requirements/index.php
sacpv04
(Sacpv04)
February 28, 2014, 5:31am
3
what do you mean? I have 2 images in one folder,I display 2 images in one php page,but it just display the jpeg image, I do not know why it do not display jpg image?
bagwari65
(Manish)
February 28, 2014, 6:10am
4
Ok try this …
Instead of Yii::app()->baseUrl
Try this: Yii::app()->getBaseUrl(true)
By default, baseUrl returns relative URL.
<img src="<?= Yii::app()->getBaseUrl(true) ?>/image/your _image.jpg" />