Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • Constants in Joomla

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 928
    Comment on it

    Hello friends,

    Today we discuss about the Joomla Constants. Joomla includes some constants that are pre-defined. These constants are basically used to get the path of the various Joomla application.

    Some of Joomla Constants are as follows:

    • JPATH_ADMINISTRATOR:
      This constant in Joomla is used to get the path of the administrator folder of the Joomla site. You need to simply write as follows:
      echo JPATH_ADMINISTRATOR;
      It will display the following output:
      /var/www/html/your-site/administrator 
    • JPATH_BASE:
      This constant returns the root path of current application. Suppose if you are accessing the front-end of Joomla then it will return the following output:
      /var/www/html/your-site

      If you are the accessing the Joomla administrator then it will return:

      /var/www/html/your-site/administrator
    • JPATH_CACHE:
      This constant display the cache folder path of the site as follows:
      /var/www/html/your-site/cache
    • JPATH_COMPONENT:
      This constant returns the path of the component that is currently executed in the site and administrator both. Suppose currently we are using users component in the site then it will display the following path:
      /var/www/html/your-site/components/com_users 
    • JPATH_COMPONENT_ADMINISTRATOR:
      This constant returns the path of the component that is currently executed in the administrator. Suppose currently we are using users component then it will display the following path:
      /var/www/html/your-site/administrator/components/com_users 
    • JPATH_COMPONENT_SITE:
      This constant returns the path of the component that is currently executed in the site(front-end of Joomla). Suppose currently we are using users component then it will display the following path:
      /var/www/html/your-site/components/com_users 
    • JPATH_CONFIGURATION:
      This constant will return the path of the folder where the configuration file is stored.
    • JPATH_INSTALLATION:
      This path return the path of the installation folder.
    • JPATH_LIBRARIES:
      This will return the path of the Joomla libraries folder as follows:
      /var/www/html/your-site/libraries 
    • JPATH_PLUGINS:
      This will display the path of the Joomla plugins folder.
    • JPATH_ROOT:
      This constant display the path where the Joomla site installed.
    • JPATH_SITE:
      This constant display the path where the Joomla site installed.
    • JPATH_THEMES:
      This constant display the path of the Joomla template folder.

 0 Comment(s)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: