JFactory/getDocument

From Joomla! Documentation

< JFactory
Revision as of 19:50, 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 document object, only creating it if it doesn't already exist. The object returned will be of type JDocument.

Syntax

object JDocument getDocument()

Example

In this example, the current page title is retrieved.

$doc =& JFactory::getDocument();
echo 'Current title is: ' . $doc->getTitle();

See also

Personal tools