Yii Framework Forum: Image path - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Image path image path problem Rate Topic: -----

#1 User is offline   Hermans 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 201
  • Joined: 17-February 11

Posted 13 May 2011 - 02:40 AM

i have image at directory :

Quote

root directory
- images
* profile.jpg




and i want to display in about page ?
this my code to get image :

Quote

<h1>About</h1>
<img src="<?php echo Yii::app()->basePath.'/images/profile.jpg' ?>" width="94" height="92" />
Hello,


but not image display.

thanks
0

#2 User is offline   twocandles 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 58
  • Joined: 23-December 10

Posted 13 May 2011 - 02:49 AM

Take a look at the page source code and check the actual image source. Then try to load that image directly into a browser window/tab
0

#3 User is offline   ncs 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 32
  • Joined: 09-February 10

Posted 13 May 2011 - 03:00 AM

Try simple
<img src="/images/profile.jpg">
0

#4 User is offline   Hermans 

  • Standard Member
  • PipPip
  • Yii
  • Group: Members
  • Posts: 201
  • Joined: 17-February 11

Posted 13 May 2011 - 03:08 AM

View Postncs, on 13 May 2011 - 03:00 AM, said:

Try simple
<img src="/images/profile.jpg">


thanks,
but can not show pictures
0

#5 User is offline   rebus 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 31
  • Joined: 07-December 09
  • Location:Ancona

Posted 13 May 2011 - 03:22 AM

Try this

<img src="<?php echo Yii::app()->request->baseUrl.'/images/profile.jpg'?>" width="94" height="92" />

0

#6 User is offline   DenizB 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 5
  • Joined: 11-May 12

Posted 03 February 2013 - 08:13 PM

View Postrebus, on 13 May 2011 - 03:22 AM, said:

Try this

<img src="<?php echo Yii::app()->request->baseUrl.'/images/profile.jpg'?>" width="94" height="92" />




Thank you brother.It works !
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users