2008-09-07

Constants of joomla 1.5

Joomla has more 400 constant, but many we don't use. Most used constant is JEXEC. It include the first line for each php-file. We verify that the file is launched from Joomla!.
For example:
defined('_JEXEC') or die('Restricted access');

Now i show most popular constant and example.
Name of constant and Description
  • DS - Separator directories (/)
  • JPATH_ADMINISTRATOR - Path to administrator part (/joomla/administrator)
  • JPATH_BASE - Path to now directory (/joomla)
  • JPATH_CACHE - Path to cache directory (/joomla/cache)
  • JPATH_COMPONENT - Path to component (/joomla/components/com_example)
  • JPATH_COMPONENT_ADMINISTRATOR - Path to administrative part of component (/joomla/administrator/components/com_example)
  • JPATH_COMPONENT_SITE - front-end of component (/joomla/components/com_example)
  • JPATH_CONFIGURATION - Configuration path(/joomla)
  • JPATH_INSTALLATION - Path to installation folder (/joomla/installation)
  • JPATH_LIBRARIES - Path to libraries (/joomla/libraries)
  • JPATH_PLUGINS - Path to plugins (/joomla/plugins)
  • JPATH_ROOT - Path to joomla front-end (/joomla)
  • JPATH_SITE - Path to site (http://joomla)
  • JPATH_THEMES - Path to templates (/joomla/templates)
Date constants
Name | Format | Example
  • DATE_FORMAT_LC | %A, %d %B %Y | Sunday, 23 June 1912
  • DATE_FORMAT_LC2 | %A, %d %B %Y %H:%M | Sunday, 23 June 1912 00:00
  • DATE_FORMAT_LC3 |%d %B %Y | 23 June 1912
  • DATE_FORMAT_LC4 | %d.%m.%y | 23.06.12