Table of Contents

getBasePath

API Package Subpackage Class Method Reference Last reviewed Doc status
API Home Package Joomla.Framework Subpackage Application Class JApplication Method getBasePath Reference 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.

Syntax

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

Examples

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/