BasePath & Url

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.

http://www.yiiframew…uest#scriptFile

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.

Do you mean

http://www.yiiframew…Manager#baseUrl

maybe basename(…) ?

@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

So I am assuming you want the parent directory of the protected folder ?:

dirname(Yii::app()->getBasePath())

Yes exacly that code. The question was if there was a method that does that?

Nope. Use dirname(Yii::app()->request->scriptFile).

thans for your comment .

it works for attaching images from the /images folder that is availavle in parent directory of protected .