Page 1 of 1
BasePath & Url
#1
Posted 14 January 2009 - 08:06 AM
Are there any methods that resolve to the base path? like where index.php is located. I looked at the reference and saw only something like
Yii::app()->getBasePath();
that resolves to the protected directory.
Yii::app()->getBasePath();
that resolves to the protected directory.
#3
Posted 14 January 2009 - 08:27 AM
that will return with the index.php in it. How about just the full path the index.php located in but without the actual file name. just the path? (I know i can do this easily with just removing index.php just want to make sure if anything else exists to avoid hard-coding stuff)
Thanks.
Thanks.
#6
Posted 14 January 2009 - 09:23 AM
@notzippy no this returns an error because i need to define the baseurl and i was talking about the basepath
@Bethrezen Nope that will return the filename for the $dir variable entered
@Bethrezen Nope that will return the filename for the $dir variable entered
#7
Posted 14 January 2009 - 09:34 AM
So I am assuming you want the parent directory of the protected folder ?:
dirname(Yii::app()->getBasePath())
dirname(Yii::app()->getBasePath())
#8
Posted 14 January 2009 - 09:48 AM
Yes exacly that code. The question was if there was a method that does that?
#10
Posted 16 July 2012 - 04:41 AM
notzippy, on 14 January 2009 - 09:34 AM, said:
So I am assuming you want the parent directory of the protected folder ?:
dirname(Yii::app()->getBasePath())
dirname(Yii::app()->getBasePath())
thans for your comment .
it works for attaching images from the /images folder that is availavle in parent directory of protected .
When I read what I write I learn what I think
Share this topic:
Page 1 of 1

Help

This topic is locked











