Yii Framework Forum: Getscriptfile() Without The File? - Yii Framework Forum

Jump to content

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

Getscriptfile() Without The File? Rate Topic: -----

#1 User is offline   Aven 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 06-October 12

Posted 31 December 2012 - 11:17 AM

Hello everyone,

Basically I just need to get the directory without the name at end of file.

Right now, the getScriptFile(); gives me:
/home/user1/public_html/website/index.php

However, I just want:.

/home/user1/public_html/website/

When I put a '../', it shows up as this:

/home/user1/public_html/website/index.php/../dir

How come it doesn't follow the normal conditions where it would go back a directory?
0

#2 User is offline   seenivasan 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 620
  • Joined: 17-June 12
  • Location:Chennai,TamilNadu,India.

Posted 01 January 2013 - 02:27 AM

Dear Friend

It can be done in the following way.

dirname(Yii::app()->request->getScriptFile());

Regards
0

#3 User is offline   Aven 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 4
  • Joined: 06-October 12

Posted 01 January 2013 - 11:29 AM

Ahh great I appreciate it thank youu!
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