| API | Package | Subpackage | Class | Method | Reference | Last reviewed | Doc status |
|---|---|---|---|---|---|---|---|
Home |
Joomla.Framework |
Application |
JApplication |
getBasePath |
getBasePath() |
Never | Internal Review |
Returns the base path of the current application.
The method is deprecated and provided for backwards compatibility with Joomla! 1.0. It is scheduled to be removed in future versions. Use JURI::base instead.
string getBasePath ( $client, $addTrailingSlash )
| $client | integer | which client to return the path for (0 - site, 1 - administrator, 2 - installation). This parameter is ignored as of Joomla! 1.5 |
| $addTrailingSlash | boolean | whether or not a trailing slash should be added to the end of the path. This parameter is ignored as of Joomla! 1.5 |
The following examples are pure academic because both parameters are ignored as of Joomla! 1.5 and always return the base path of the active application including the trailing slash.
Example: JSite
global $mainframe; echo $mainframe->getBasePath( 0, true )
might display the following:
Result
http://www.example.com/joomla15/
Example: JAdministrator
global $mainframe; echo $mainframe->getBasePath( 1, true )
might display the following:
Result
http://www.example.com/joomla15/administrator/
Example: JInstaller
global $mainframe; echo $mainframe->getBasePath( 2, true )
might display the following:
Result
http://www.example.com/joomla15/installation/