Yii Framework Forum: Images path - Yii Framework Forum

Jump to content

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

Images path Rate Topic: -----

#1 User is offline   petko 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 34
  • Joined: 24-February 10
  • Location:Bulgaria

Posted 17 May 2010 - 09:20 AM

How can I get 'images' folder path under both XAMPP (Windows) and on the deploy server (Linux)?

Yii::app()->basePath
is possible solution, but it includes the 'protected' folder part. I can strip that, but I want a generic solution, which to work even if 'images' path has other location.
0

#2 User is offline   zaccaria 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 2,232
  • Joined: 04-October 09
  • Location:Moscow

Posted 17 May 2010 - 09:32 AM

I use

 Yii::app()->basePath.'../images' 


Otherway you can use the alias webroot (webroot.images)

Take a look at this
0

#3 User is offline   petko 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 34
  • Joined: 24-February 10
  • Location:Bulgaria

Posted 17 May 2010 - 10:14 AM

Thank you very much!
0

#4 User is offline   Liam Carter 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 18
  • Joined: 30-August 12

Posted 15 November 2013 - 11:44 AM

I found

Yii::app()->baseUrl.'/images' 


worked better for me

Regards
0

#5 User is offline   KonApaz 

  • Elite Member
  • PipPipPipPipPip
  • Yii
  • Group: Members
  • Posts: 1,306
  • Joined: 21-February 11
  • Location:Greece

Posted 15 November 2013 - 12:51 PM

View PostLiam Carter, on 15 November 2013 - 11:44 AM, said:

I found

Yii::app()->baseUrl.'/images' 


worked better for me

Regards


The default way is that for me for a long time

Yii::app()->baseUrl gives me localhost/myproject on localhost or www.mydomain.com online so Yii::app()->baseUrl.'/images' gives the folder url for images both of two cases.
Yii is the best php framework in the world!
find our demo Yii extension on www.webkit.gr
Is it post useful? please v++ ;)
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