JFactory/getLanguage

From Joomla! Documentation

< JFactory
Revision as of 19:51, 23 November 2008 by Chris Davenport (Talk | contribs)
(diff) ←Older revision | Current revision (diff) | Newer revision→ (diff)
Jump to: navigation, search

Returns a reference to the global language object, only creating it if it doesn't already exist. The object returned will be of type JLanguage.

Syntax

object JLanguage getLanguage()

Example

The following code gets the name of the current language.

$lang =& JFactory::getLanguage();
echo 'Current language is: ' . $lang->getName();

See also

Personal tools