JFactory Class
(Added method list) |
|||
| (5 intermediate revisions by one user not shown) | |||
| Line 1: | Line 1: | ||
| − | + | [[JFactory]] | |
| − | + | ||
| − | + | ||
| − | + | ''JFactory'' provides access to a group of core Joomla Objects. In each case it returns an object, usually with the current site settings. | |
| − | + | ||
| − | + | ==getApplication()== | |
| − | + | ||
| + | Returns a reference to the Global [[JApplication]] object | ||
| + | <source lang='php'>$app =& JFactory::getApplication();</source> | ||
| − | + | ==getCache()== | |
| − | + | ||
| − | + | Returns a reference to the Global [[JCache]] object | |
| − | + | <source lang='php'>$cache =& JFactory::getCache();</source> | |
| + | |||
| + | ==getConfig()== | ||
| + | |||
| + | Returns a reference to the Global [[JConfig]] object | ||
| + | <source lang='php'>$config =& JFactory::getConfig();</source> | ||
| + | |||
| + | ==getDate()== | ||
| + | |||
| + | Returns a reference to the Global [[JDate]] object | ||
| + | <source lang='php'>$date =& JFactory::getDate();</source> | ||
| + | |||
| + | ==getDBO()== | ||
| + | |||
| + | Returns a reference to the Global [[JDatabase]] object | ||
| + | <source lang='php'>$db =& JFactory::getDBO();</source> | ||
| + | |||
| + | ==getDocument()== | ||
| + | |||
| + | Returns a reference to the Global [[JDocument]] object | ||
| + | <source lang='php'>$doc =& JFactory::getDocument();</source> | ||
| + | |||
| + | ==getEditor()== | ||
| + | |||
| + | Returns a reference to the Global [[JEDitor]] object | ||
| + | <source lang='php'>$editor =& JFactory::getEditor();</source> | ||
| + | |||
| + | ==getLanguage()== | ||
| + | |||
| + | Returns a reference to the Global [[JLanguage]] object | ||
| + | <source lang='php'>$lang =& JFactory::getLanguage();</source> | ||
| + | |||
| + | ==getMailer()== | ||
| + | |||
| + | Returns a reference to the Global [[JMailer]] object | ||
| + | <source lang='php'>$mailer =& JFactory::getMailer();</source> | ||
| + | |||
| + | ==getSession()== | ||
| + | |||
| + | Returns a reference to the Global [[JSession]] object | ||
| + | <source lang='php'>$session =& JFactory::getSession();</source> | ||
| + | |||
| + | ==getTemplate()== | ||
| + | |||
| + | Returns a reference to the Global [[JTemplate]] object | ||
| + | <source lang='php'>$template =& JFactory::getTemplate();</source> | ||
| + | |||
| + | ==getURI()== | ||
| + | |||
| + | Returns a reference to the Global [[JURI]] object | ||
| + | <source lang='php'>$uri =& JFactory::getURI();</source> | ||
| + | |||
| + | ==getUser()== | ||
| + | |||
| + | Returns a reference to the Global [[JUser]] object | ||
| + | <source lang='php'>$user =& JFactory::getUser();</source> | ||
| + | |||
| + | ==getXMLParser()== | ||
| + | |||
| + | Returns a reference to the Global [[JXMLParser]] object | ||
| + | <source lang='php'>$xmlp =& JFactory::getXMLParser();</source> | ||
| + | Takes parameters: $type & $options | ||
| + | $type can take the values 'DOM' (default), 'RSS', or 'Simple' | ||
| + | $options takes an options array (default is empty) | ||
| + | boolean ['lite'] for use with DOM to use domit_lite (default) | ||
| + | string [#rssUrl'] for use with 'RSS' | ||
| + | string [cache_time'] feed cache time for 'RSS' (default = 3600 seconds) | ||
== See Also == | == See Also == | ||
* [http://api.joomla.org/Joomla-Framework/JFactory.html JFactory class documentation from the Joomla! API] | * [http://api.joomla.org/Joomla-Framework/JFactory.html JFactory class documentation from the Joomla! API] | ||
| − | |||
[[Category:Development]] | [[Category:Development]] | ||
Latest revision as of 05:31, 11 April 2009
JFactory provides access to a group of core Joomla Objects. In each case it returns an object, usually with the current site settings.
Contents |
[edit] getApplication()
Returns a reference to the Global JApplication object
$app =& JFactory::getApplication();
[edit] getCache()
Returns a reference to the Global JCache object
$cache =& JFactory::getCache();
[edit] getConfig()
Returns a reference to the Global JConfig object
$config =& JFactory::getConfig();
[edit] getDate()
Returns a reference to the Global JDate object
$date =& JFactory::getDate();
[edit] getDBO()
Returns a reference to the Global JDatabase object
$db =& JFactory::getDBO();
[edit] getDocument()
Returns a reference to the Global JDocument object
$doc =& JFactory::getDocument();
[edit] getEditor()
Returns a reference to the Global JEDitor object
$editor =& JFactory::getEditor();
[edit] getLanguage()
Returns a reference to the Global JLanguage object
$lang =& JFactory::getLanguage();
[edit] getMailer()
Returns a reference to the Global JMailer object
$mailer =& JFactory::getMailer();
[edit] getSession()
Returns a reference to the Global JSession object
$session =& JFactory::getSession();
[edit] getTemplate()
Returns a reference to the Global JTemplate object
$template =& JFactory::getTemplate();
[edit] getURI()
Returns a reference to the Global JURI object
$uri =& JFactory::getURI();
[edit] getUser()
Returns a reference to the Global JUser object
$user =& JFactory::getUser();
[edit] getXMLParser()
Returns a reference to the Global JXMLParser object
$xmlp =& JFactory::getXMLParser();
Takes parameters: $type & $options $type can take the values 'DOM' (default), 'RSS', or 'Simple' $options takes an options array (default is empty) boolean ['lite'] for use with DOM to use domit_lite (default) string [#rssUrl'] for use with 'RSS' string [cache_time'] feed cache time for 'RSS' (default = 3600 seconds)