Actions

API15

Difference between revisions of "JFactory Class"

From Joomla! Documentation

(Examples)
Line 8: Line 8:
 
Access a document:
 
Access a document:
 
     $document =& JFactory::getDocument();
 
     $document =& JFactory::getDocument();
 
  
 
     $uri =& JFactory::getURI();     
 
     $uri =& JFactory::getURI();     

Revision as of 06:30, 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:

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

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

    $user =& JFactory::getUser();

See Also