basePath really?
#1
Posted 12 October 2009 - 05:30 PM
So, why does echo Yii::app()->basePath; always return /mypath/protected/ ?
It would be far more useful if it returned the expected /mypath/
It seems we have nice easy properties for all the expected directories: modulePath, extensionPath,runtimePath,basePath(/protected/) except the actual root.
How about adding one?
#4
Posted 13 October 2009 - 08:24 PM
#5
Posted 13 October 2009 - 08:43 PM
you can get the "/yourWeb" relative URL by baseUrl property;
#6
Posted 13 October 2009 - 09:00 PM
dirname(Yii::app()->request->scriptFile) works, so that is what I will use.
#7
Posted 13 October 2009 - 11:17 PM
params = array( ... 'webRoot' => dir(dirname(__FILE__).DIRECTORY_SEPARATOR.'..') )
call Yii::app()->params['webRoot'],
#8
Posted 14 October 2009 - 01:39 AM
Object of class Directory could not be converted to string
#10
Posted 14 October 2009 - 01:31 PM
Backslider, on 13 October 2009 - 09:00 PM, said:
dirname(Yii::app()->request->scriptFile) works, so that is what I will use.
I think we have lost the point of my first post and now are looking at everything that does NOT work.
My original point was that a property that points to the root directory of the application should be available, just as it is for other directories such as modulePath, extensionPath, runtimePath etc.
#11
Posted 14 October 2009 - 03:54 PM
Backslider, on 14 October 2009 - 01:31 PM, said:
My original point was that a property that points to the root directory of the application should be available, just as it is for other directories such as modulePath, extensionPath, runtimePath etc.
you can request this feature here
http://www.yiiframew...ature-requests/
the dev team will decide
#13
Posted 15 October 2009 - 04:00 AM
'webRoot' => dir(dirname(__FILE__).DIRECTORY_SEPARATOR.'..')
to
'webRoot' => dirname(dirname(__FILE__).DIRECTORY_SEPARATOR.'..')
#16
Posted 21 October 2009 - 02:36 AM
Yii extends YiiBase so Yii::getPathOfAlias() is valid.
#17
Posted 21 October 2009 - 08:48 AM
#18
Posted 21 October 2009 - 08:51 AM
#19
Posted 22 November 2011 - 06:52 AM
Yii::app()->basePath . '../';
Backslider, on 12 October 2009 - 05:30 PM, said:
So, why does echo Yii::app()->basePath; always return /mypath/protected/ ?
It would be far more useful if it returned the expected /mypath/
It seems we have nice easy properties for all the expected directories: modulePath, extensionPath,runtimePath,basePath(/protected/) except the actual root.
How about adding one?

Help
This topic is locked














