Actions

API15

Difference between revisions of "JFactory Class"

From Joomla! Documentation

(Examples)
Line 1: Line 1:
 
== Examples ==
 
== Examples ==
Access JFactory:
+
Access [[JFactory]]:
 
     $var =& JFactory::content();
 
     $var =& JFactory::content();
  
Access an open database via JFactory:
+
Access an open database via [[JFactory]]:
 
     $database =& JFactory::getDBO();
 
     $database =& JFactory::getDBO();
  
Access a document:
+
Access a document using [[JFactory]]:
 
     $document =& JFactory::getDocument();
 
     $document =& JFactory::getDocument();
  
Line 15: Line 15:
  
 
== 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]
 
* [[Accessing_the_current_user_object]]
 
* [[Accessing_the_current_user_object]]
  
 
[[Category:Development]]
 
[[Category:Development]]

Revision as of 07:38, 4 September 2008

Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Examples

Access JFactory:

    $var =& JFactory::content();

Access an open database via JFactory:

    $database =& JFactory::getDBO();

Access a document using JFactory:

    $document =& JFactory::getDocument();
    $uri =& JFactory::getURI();     
    

The following provides access to the logged-in user info.

    $user =& JFactory::getUser();

See Also