| API | Package | Subpackage | Class | Method | Reference | Last reviewed | Doc status |
|---|---|---|---|---|---|---|---|
Home |
Joomla.Framework |
Document |
JDocument |
getInstance |
getInstance() |
Never | Work in Progress |
This function returns an object that is of a type that is dependent on the document type. The default document type is html. Currently this is the only type that has been implemented.
This method must be invoked as:
$document = &JDocument::getInstance();
jdocument &getInstance ( $type, $attributes )
| $type | type | is a string containing the type of document to instantiate. |
| $attributes | mixed | is an associative array containing the attributes to pass to the class constructor. See __construct for more information. |
This function is called from the JApplication::getDocument function and should not need to be called otherwise. This function is called in the following way:
Example
$attributes = array ( 'charset' => 'utf-8', 'lineend' => 'unix', 'tab' => ' ', 'language' => 'en-GB' ); jimport('joomla.document.document'); $instance =& JDocument::getInstance('html', $attributes);
This results in an object of type JDocumentHTML being assigned to the $instance variable.